Yala Yala Herzlin
Yala Yala Herzlin

Reputation: 622

Htaccess: redirect from old domain to new

I have a olddomain.com that needs to point to newdomain.com

so if somebody tries to enter oldomain.com/whatever they get to newdomain.com

i dont wnat to exactly map old urls so just that would be ok i have tried with

RewriteEngine On
Redirect 301 / http://www.newdomain.com

but it doent work well if i try with

oldomain.com/whatever  

the url appears in the broswer:

newdomain.comwhatever 

(without the /)

Upvotes: 3

Views: 55

Answers (1)

jfatal
jfatal

Reputation: 253

This should work:

RewriteEngine On
RewriteRule ^(.*)$ http://newdomain.com/$1 [R=301,NC]

Upvotes: 1

Related Questions