Обучение/Помощь новичкам | Проблемы с ЧПУ .htaccess
Мне нужно скрыть папку plugins . Использую этот код:
Чтобы откраивало:
http://site/rules за месть http://site/plugins/rules и также работали все под папки в папке rules
Перестает работать /index.php
Но зато работает http://site/rules
Чтобы откраивало:
http://site/rules за месть http://site/plugins/rules и также работали все под папки в папке rules
RewriteBase /
RewriteCond %{REQUEST_URI} !^/plugins/
RewriteRule ^(.*)$ /plugins/$1 Перестает работать /index.php
Но зато работает http://site/rules
417809707 , вообще я делаю так
RewriteEngine on
RewriteRule ^rules$ /plugins/rules.php
ExcLuSiVe , мне нужно чтобы не не определенный файл а рекусивно все что
в папке plagins применялось с корня
в папке plagins применялось с корня
417809707 , вроде так нельзя
ExcLuSiVe (26.01.2019 в 14:02)
417809707 , вроде так нельзя
417809707 , вроде так нельзя
Можно я раньше как то делал!
Скин полный код
Boy (26.01.2019 в 14:03)
Скин полный код
Скин полный код
# так безопаснее
php_value register_globals Off
# убираем экранирование кавычек
php_value magic_quotes_gpc Off
# дописываем сессию к URL
php_value session.use_trans_sid On
php_value session.cookie_lifetime Off
# кодировка по-умолчанию
AddDefaultCharset UTF-8
DirectoryIndex index.php
Options -Indexes
# Включаем отслеживание сим-ссылок
Options +FollowSymLinks
# Запускаем url_rewriting
RewriteEngine On
# Блокируем все ссылки, содержащие <script>
RewriteCond %{QUERY_STRING} (<|%3C).*script.*(>|%3E) [NC,OR]
# Блокируем все скрипты, которые пытаются изменить переменные PHP Globals:
RewriteCond %{QUERY_STRING} GLOBALS(=|[|%[0-9A-Z]{0,2}) [OR]
# Блокируем все скрипты, которые пытаются изменить переменную _REQUEST:
RewriteCond %{QUERY_STRING} _REQUEST(=|[|%[0-9A-Z]{0,2})
# Перенаправляем все подобные на страницу с ошибкой 403 - запрещено
RewriteRule ^(.*)$ index.php [F,L]
php_value url_rewriter.tags On
php_value magic_quotes_runtime Off
php_value magic_quotes_sybase Off
php_value file_uploads On
php_value date.timezone "Europe/Moscow"
php_value short_open_tag On
php_value session.cookie_domain ".site.ru"
# Модули сайта
# RewriteBase /
# RewriteCond %{REQUEST_URI} !^/plugins/
# RewriteRule ^(.*)$ /plugins/$1
RewriteRule ^$1 /plugins/$1
<Files count.php>
order allow,deny
deny from all
</Files>
<IfModule mod_headers.c>
<FilesMatch .*.(js|css)$>
Header set Cache-control: private
</FilesMatch>
<FilesMatch .*.(gif|jpg|png)$>
Header set Cache-control: public
</FilesMatch>
</IfModule>
# Анкеты пользователей
<IfModule mod_rewrite.c>
RewriteRule ^id([0-9]*) info.php?id=$1 [L,QSA]
</IfModule>
# Убираем расширение файла из URL
RewriteRule ^(([^/]+/)*[^.]+)$ /$1.php [L]
# Удаляем plugins из URL
RewriteRule ^plugins/(.+)$ http://site.ru/$1
# Сжимаем компоненты сайта путем включения Gzip
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css application/x-javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch bMSIE !no-gzip !gzip-only-text/html
# Сжимаем элементы с помощью mod_deflate
<ifmodule mod_deflate.c="">
<filesmatch .(js|css)$="">
SetOutputFilter DEFLATE
</filesmatch>
</ifmodule>
# Усиливаем кеширование
FileETag MTime Size
<ifmodule mod_expires.c>
<filesmatch ".(jpg|gif|png|css|js)$">
ExpiresActive on
ExpiresDefault "access plus 1 year"
</filesmatch>
</ifmodule>
# задаем соответствие mime типов расширению
AddType text/vnd.wap.wml;charset=utf-8 .wml
AddType application/vnd.sonyericsson.mms-template tpl
AddType application/vnd.wap.wmlc .wmlc
AddType text/vnd.wap.wmlscript .wmls
AddType application/vnd.wap.wmlscriptc .wmlsc
AddType image/vnd.wap.wbmp .wbmp
AddType application/vnd.eri.thm .thm
AddType application/vnd.mophun.application .mpn
AddType application/vnd.mophun.certificate .mpc
AddType text/vnd.sun.j2me.app-descriptor .jad
Addtype text/x-vmel .mel
Addtype audio/imelody .imy
AddType application/vnd.smaf .mmf
Addtype text/x-vmel .emy
AddType audio/amr .amr
AddType audio/x-wav .wav
AddType application/x-tar .hid
Addtype image/jpeg .jpg
Addtype image/jpeg .jpeg
Addtype image/gif .gif
Addtype image/png .png
Addtype image/bmp .bmp
Addtype text/x-imelody .imy
Addtype text/x-emelody .emy
Addtype text/x-vcard .vcf
Addtype text/x-vcalendar .vcs
Addtype text/calendar .ics
Addtype application/smil .smil
Addtype application/smil .smi
Addtype application/java-archive .jar
Addtype application/vnd.symbian.install .sis
Addtype audio/wav .wav
Addtype audio/midi .midi
Addtype audio/midi .mid
Addtype audio/rmf .rmf
Addtype application/vnd.wap.mms-message .mms
AddType video/flv .flv
AddType video/mp4 .mp4
Addtype video/3gpp .3gp
Addtype application/zip .zip
Addtype audio/mpeg .mp3
# переопределяем страницы ошибок
ErrorDocument 400 /err.php?err=400
ErrorDocument 401 /err.php?err=401
ErrorDocument 402 /err.php?err=402
ErrorDocument 403 /err.php?err=403
ErrorDocument 404 /err.php?err=404
ErrorDocument 500 /err.php?err=500
ErrorDocument 502 /err.php?err=502
________
посл. ред. 26.01.2019 в 14:14; всего 1 раз(а); by 417809707
RewriteRule ^plugins/?$ plugins/index.php [L,QSA]
RewriteRule ^plugins/([^/]*)/?$ plugins/$1.php [L,QSA]
RewriteRule ^plugins/([^/]*)/?$ plugins/$1.php [L,QSA]
далее при открывании
/plugins/lolo/ - будет открывать /plugins/lolo.php
________
посл. ред. 26.01.2019 в 14:23; всего 1 раз(а); by [Brony] pimnik98
[Brony] pimnik98 (26.01.2019 в 14:22)
RewriteRule ^plugins/?$ plugins/index.php [L,QSA]
RewriteRule ^plugins/([^/]*)/?$ plugins/$1.php [L,QSA]
далее при открывании
/plugins/lolo/ - будет открывать /plugins/lolo.php
RewriteRule ^plugins/?$ plugins/index.php [L,QSA]
RewriteRule ^plugins/([^/]*)/?$ plugins/$1.php [L,QSA]
далее при открывании
/plugins/lolo/ - будет открывать /plugins/lolo.php
мне надо папку
417809707 (26.01.2019 в 14:47)
[Brony] pimnik98 (26.01.2019 в 14:22)
RewriteRule ^plugins/?$ plugins/index.php [L,QSA]
RewriteRule ^plugins/([^/]*)/?$ plugins/$1.php [L,QSA]
далее при открывании
/plugins/lolo/ - будет открывать /plugins/lolo.php
мне надо папку
[Brony] pimnik98 (26.01.2019 в 14:22)
RewriteRule ^plugins/?$ plugins/index.php [L,QSA]
RewriteRule ^plugins/([^/]*)/?$ plugins/$1.php [L,QSA]
далее при открывании
/plugins/lolo/ - будет открывать /plugins/lolo.php
мне надо папку
RewriteRule ^plugins/([^/]*)/([^/]*)/?$ plugins/$1/$2.php [L,QSA]
или как?
я просто не понял
приведи пример:
Файл по которому юзер должен заходить по ссылке
Путь к файлу
Стр.: 1, 2