开发者

Subdomain to new domain redirection

I need simple code to do something like this.

For example开发者_运维百科 my old site page is www.old.com/homerun.html, I want to redirect to a new page www.new.com/homerun/, or www.old.com/themes/newpage.html to www.new.com/themes/newpage/.

So basically it will replace the domain and remove the .html.

could this be done on htaccess?


Try something like the following (on the old host, root path)

RewriteEngine On
RewriteBase /

RewriteRule ^(.+?)(.html)$ http://www.new.com/$1/ [L,R]
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜