Jamesking56 Posted April 24, 2010 Share Posted April 24, 2010 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 More sharing options...
chibineku Posted April 24, 2010 Share Posted April 24, 2010 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 More sharing options...
Jamesking56 Posted April 24, 2010 Author Share Posted April 24, 2010 That code does not work in my .htaccess file.... it still allows any! Link to comment Share on other sites More sharing options...
chibineku Posted April 24, 2010 Share Posted April 24, 2010 Oh, try adding [R=301] to the end of each line Link to comment Share on other sites More sharing options...
trinistorm Posted April 24, 2010 Share Posted April 24, 2010 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 More sharing options...
chibineku Posted April 24, 2010 Share Posted April 24, 2010 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 More sharing options...
Jamesking56 Posted April 24, 2010 Author Share Posted April 24, 2010 I cannot do that because they are scripts not actually my code Link to comment Share on other sites More sharing options...
chibineku Posted April 25, 2010 Share Posted April 25, 2010 well, did adding [R=301] to the RewriteRule lines work? Link to comment Share on other sites More sharing options...
Jamesking56 Posted April 25, 2010 Author Share Posted April 25, 2010 No, can someone make a proper code with full tutorial and test before publishing please I really need this to work! Link to comment Share on other sites More sharing options...
trinistorm Posted April 25, 2010 Share Posted April 25, 2010 I think you need to describe your hosting set up. Link to comment Share on other sites More sharing options...
justsomeguy Posted April 25, 2010 Share Posted April 25, 2010 No, can someone make a proper code with full tutorial and test before publishing please I really need this to work!If it was that important to you then you would be doing your own research to figure out how to do it with your setup.http://www.google.com/search?hl=en&saf...q=&gs_rfai= Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.