redirect one domain to another with htaccess rules
I was wondering how i can redirect my users from my old domain to a new url
forexample
http://www.5.joblessbuddy.com/news.html
into this
http://www.1.joblessbuddy.hu/news.html
i did this on my htaccess but not working
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} http://www.5.joblessbuddy.com/$ [NC]
RewriteRule ^(.*)$ ht开发者_运维问答tp://www.1.joblessbuddy.hu$1 [R=301,L]
any suggestion would be appreciated
thanks in advance
Try this:
RewriteCond %{HTTP_HOST} (www\.)?5\.joblessbuddy\.com [NC]
RewriteRule ^(.*)$ http://www.1.joblessbuddy.hu/$1 [R=301,L]
btw: mod_rewrite cheat sheet v2 is your friend.
精彩评论