开发者

redirect one domain to another with htaccess rules

开发者 https://www.devze.com 2023-02-11 11:44 出处:网络
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

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

精彩评论

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