Mod_Rewrite problem with sub-domains.

Using a single web hosting account to host multiple sites

Mod_Rewrite problem with sub-domains.

Postby phpsoft » Tue Mar 02, 2010 9:32 pm

I set up a Mod_Rewrite on my main account and this is the code:
Code: Select all
RewriteEngine on

<Files 403.shtml>
order allow,deny
allow from all
</Files>

RewriteCond %{HTTP_HOST} ^([a-z.]+\.)?mydomain\.com$ [NC]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .? http://www.%1mydomain.com%{REQUEST_URI} [R=301,L]


Now the issue is that my two sub-domains, http://sitebuilder.mydomain.com/ redirects to http://www.sitebuilder.mydomain.com/ and http://webdesigning.mydomain.com/ redirects to http://www.webdesigning.mydomain.com/.

You can notice it adds "www" which is not what I intend to get. I will appreciate any help.
phpsoft
 
Posts: 4
Joined: Wed Oct 14, 2009 7:15 am

Return to Domain Handling

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest

cron