Forum Moderators: phranque
I'm using mod-rewrite to point non-www version to the www version for the primary domain, but it's not working for the subdomains. I have .htaccess files in their root directories and have done the same for each, but nothing happens (both non and www versions are available to the browser). Any ideas?
TIA,
RS
[edited by: jatar_k at 9:23 pm (utc) on Aug. 8, 2005]
[edit reason] generalized urls [/edit]
As defined, www.example1.com and www.example2.com are not subdomains of www.example.com. They are simply two additional domains.
What you may mean is that you have two additional domains hosted in subdirectories of your main account, which was originally set up to host www.example.com, but I can't be sure. However, that does not make them subdomains; a subdomain of example.com would be foo.example.com or bar.example.com, or www.foo.example.com. In fact, www.example.com is a subdomain of example.com.
Please post the code you are trying to use, and specify *where* in your directory structure you have placed that code.
Jim
I use this in the .htaccess file:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^primarysite\.com
RewriteRule (.*) [primarysite.com...] [R=301,L]
Which works great. The root directories of the other two domains are:
/var/www/subsite1/
/var/www/subsite2/
I placed the same rewrite statement in each of those root htaccess files and it doesn't work. These domains are above/outside of the root of the primary site. Help appreciated...
RS