Subdomain Is Redirected and Causing an Error Because www. is Added
Posted
by
user532493
on Pro Webmasters
See other posts from Pro Webmasters
or by user532493
Published on 2012-06-30T16:14:11Z
Indexed on
2012/07/01
3:24 UTC
Read the original article
Hit count: 206
On my site, say example.com, if I try to access test.example.com, Firefox automatically adds www. to test.example.com, making it www.test.example.com, which causes an error. However, if I visit a site like my.ebay.com, no www. is added so no error occurs. What's going on?
Just in case, my .htaccess file is as follows:
Options -Multiviews
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ $1.php
I looked through Firebug and it seems like Firefox doesn't even make an attempt to reach test.example.com before reverting to www.test.example.com.
One nuance I didn't realize until now. If I try to access the site using test.example.com/, the www. is added. If however that trailing slash is not there, then I am sent to the subdomain properly.
© Pro Webmasters or respective owner