Jump to content

How to force subdomain?


Jamesking56

Recommended Posts

Hey!I have a web address and I'm in need of htaccess code to force a subdomain for it. I have a subdomain setup so I can access a folder hrough 3 different urls:http://mydomain.com/bugs/http://www.mydomain.com/bugs/http://bugs.mydomain.comI would like to FORCE the last one so that the other URLs would redirect to that URL.Can someone help?btw. I have MOD_Rewrite installed.

Link to comment
Share on other sites

RewriteRule ^mydomain.com/bugs$ / bugs.mydomain.comRewriteRule ^www.mydomain.com/bugs$ / bugs.mydomain.comSeems a weird thing to do though.

Link to comment
Share on other sites

Oh, try adding [R=301] to the end of each line

Link to comment
Share on other sites

How about an index file that contains a header to the folder you want ?

header('Location: http://www.bugs.mydomain.com');

Link to comment
Share on other sites

Good idea - again, worth adding the 301 header before the location header:header("HTTP/1.1 301 Moved Permanantly");

Link to comment
Share on other sites

well, did adding [R=301] to the RewriteRule lines work?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...