开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜