Forum Moderators: phranque

Message Too Old, No Replies

301 redirect

htaccess, 301 redirect

         

gigamike

1:58 am on Jul 18, 2014 (gmt 0)

10+ Year Member



Guys,

I hope you can help me, is it possible on .htaccess for 301 redirect

Here's the list of URLs that are in use:

http://companyname.example.com/
http://www.companyname.example.com/
http://example.com/companyname
http://www.example.com/companyname

I want to 301 redirect all these types of URLs to this format:

http://companyname.example.com/

Any sample htaccess code?

Thanks,

Mike

[edited by: Ocean10000 at 4:39 am (utc) on Jul 18, 2014]
[edit reason] Examplified [/edit]

not2easy

5:23 am on Jul 18, 2014 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Hi gigamike, welcome to the forums. Is this a new site or do you currently have a RewriteRule in place to deal with the www/non www canonical and it is sending everyone to the non www version? I ask because you should have one to currently handle that and it would mean that you only need help with one change.

phranque

12:13 pm on Jul 18, 2014 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



welcome to WebmasterWorld, Mike!


you're going to have to show something you tried.


http://www.webmasterworld.com/apache/charter.htm [webmasterworld.com]:
It is not appropriate to expect other members to write your code for you...