Created
February 4, 2015 10:41
-
-
Save obojdi/4aa9229f2c18f8552117 to your computer and use it in GitHub Desktop.
apache standard conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DirectoryIndex index.php | |
ErrorDocument 404 /404/ | |
RewriteEngine On | |
Options +FollowSymlinks | |
Options -Indexes -MultiViews | |
################################################################ | |
# | |
# СТАНДАРТНЫЕ ПРЕОБРАЗОВАНИЯ | |
# | |
################################################################ | |
# Два слэша в один | |
RewriteCond %{THE_REQUEST} /[/] | |
RewriteRule ^.*$ http://%{HTTP_HOST}/? [R=301,L] | |
# Убраем index из урла | |
RewriteCond %{REQUEST_URI} ^/index\.(.+)$ | |
RewriteRule ^.*$ http://%{HTTP_HOST}/? [R=301,L] | |
# если обращение к директории без слеш на конце урла - добавляем / | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_URI} !\..+$ | |
RewriteCond %{REQUEST_URI} !/$ | |
RewriteRule (.*) /$1/ [R=301,L] | |
#закрываем запуск .inc файлов | |
RewriteCond %{REQUEST_URI} \.inc | |
RewriteRule ^.*$ http://%{HTTP_HOST}/? [R=404,L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment