Welcome to WebmasterWorld Guest from 54.144.206.214

Forum Moderators: Ocean10000 & incrediBILL & phranque

How to permanently redirect mydomain.com to WWW.madomain.com?

   
7:43 pm on Dec 11, 2008 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member



I would like to know hiw is correct code to permanently redirect to

RewriteCond %{HTTP_HOST} ^mydomain\.com
RewriteRule ^(.*)$ [mydomain.com...] [R=permanent,L]

This code does not work.

7:47 pm on Dec 11, 2008 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



In what way does it not work?

You probably need

RewriteEngine On
too.

^(.*)$
simplifies to
(.*)
3:29 pm on Dec 12, 2008 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member



Can you put all code? I'm new to this.thank you
4:56 pm on Dec 12, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



this works for me:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com
RewriteRule ^(.*)$ http://www.example.com/$1 [R=permanent,L]

7:52 pm on Dec 12, 2008 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



^(.*)$
simplifies to
(.*)
4:40 pm on Dec 13, 2008 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member



Thank you
4:56 pm on Dec 13, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



scanned the post without sufficient caffeine!

^(.*)$ simplifies to (.*)

thanks g1smd, will give that a try

any performance benefits?

 

Featured Threads

Hot Threads This Week

Hot Threads This Month