Skip to content

Instantly share code, notes, and snippets.

@zetrider
Created June 6, 2016 08:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zetrider/0fa5e608f4cc7ce15219d8f050c6e387 to your computer and use it in GitHub Desktop.
Save zetrider/0fa5e608f4cc7ce15219d8f050c6e387 to your computer and use it in GitHub Desktop.
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
# Редирект с www на без www
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
# Удаляем index.php из адреса
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
# Не применяем к админке, иначе перестает работать страница Highload-блоки
RewriteCond %{REQUEST_URI} !/bitrix/admin/.* [NC]
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !/bitrix/urlrewrite.php$
RewriteRule ^(.*)$ /bitrix/urlrewrite.php [L]
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment