Forum Moderators: phranque

Message Too Old, No Replies

getting http:// to go to http://www.

         

planbeta

11:01 am on Nov 17, 2003 (gmt 0)

10+ Year Member



I am trying figure out the best way to get [*mysite.com...] to redirect to [*mysite.com...]

I'm guessing use of .htaccess is the way to go, but I'm not sure how.

Is this possible?

Thanks

Chris

Yidaki

11:19 am on Nov 17, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yep, .htaccess is fine. Here's a rule for ya:

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

[edited by: DaveAtIFG at 1:51 pm (utc) on Nov. 17, 2003]
[edit reason] DeLinked URL [/edit]

planbeta

11:29 am on Nov 17, 2003 (gmt 0)

10+ Year Member



Brilliant, that does the job!

Cheers

Chris

bluedevil

9:34 pm on Nov 17, 2003 (gmt 0)

10+ Year Member



You can also do this in the apache conf file

RedirectMatch 301 (.*) [domain.com$1...]
ServerName domain.com