P
P
PO6OT2015-07-05 21:41:47
Apache HTTP Server
PO6OT, 2015-07-05 21:41:47

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>

There is an index.html file in the /.sub/old/ folder at the root of the site, but when requesting old.site.com, the error Err_Name_Not_Resolved

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question