Created
April 24, 2017 11:05
-
-
Save psics/6014542a79e95889eb2bff6e923c67ad to your computer and use it in GitHub Desktop.
htaccess редирект на без www и без /
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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{REQUEST_URI} ^\/$ | |
RewriteCond %{HTTP_HOST} ^www\.(.*)$ | |
RewriteRule ^(.*)$ http://%1/$1 [L,R=301] | |
RewriteCond %{REQUEST_URI} !\? | |
RewriteCond %{REQUEST_URI} !\& | |
RewriteCond %{REQUEST_URI} !\= | |
RewriteCond %{REQUEST_URI} !\. | |
RewriteCond %{REQUEST_URI} \/$ | |
RewriteCond %{HTTP_HOST} ^www\.(.*)$ | |
RewriteRule ^(.*)\/$ http://%1/$1 [L,R=301] | |
RewriteCond %{REQUEST_URI} !\? | |
RewriteCond %{REQUEST_URI} !\& | |
RewriteCond %{REQUEST_URI} !\= | |
RewriteCond %{REQUEST_URI} !\. | |
RewriteCond %{REQUEST_URI} !\/$ | |
RewriteCond %{HTTP_HOST} ^www\.(.*)$ | |
RewriteRule ^(.*)$ http://%1/$1 [L,R=301] | |
RewriteCond %{REQUEST_URI} !\? | |
RewriteCond %{REQUEST_URI} !\& | |
RewriteCond %{REQUEST_URI} !\= | |
RewriteCond %{REQUEST_URI} !\. | |
RewriteCond %{REQUEST_URI} \/$ | |
RewriteCond %{HTTP_HOST} ^([^www].*)$ | |
RewriteRule ^(.*)\/$ http://%1/$1 [L,R=301] | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment