Answer the question
In order to leave comments, you need to log in
Why doesn't subdomain redirection work?
Here is the Rewrite .htaccess part at the root of the site (see #SubDomains):
#Rewrite
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
#NoWWW
Options +FollowSymLinks
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
#NoSlashes
DirectorySlash Off
RewriteCond %{HTTP_HOST} (.*)
RewriteCond %{REQUEST_URI} /$ [NC]
RewriteRule ^(.*)(/)$ $1 [L,R=301]
#AllRequestsToIndex
RewriteRule ^([A-Za-z0-9\/\?\&\=\+\%]+)$ index.html [L]
#SubDomains
RewriteCond %{HTTP_HOST} ^([^\.]+)\.([^\.]+).([^\.]+) [NC]
RewriteCond %{HTTP_HOST} !^www\.(.*) [NC]
RewriteRule ^(.*)$ /.sub/%1$1 [L,QSA]
</IfModule>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question