开发者

Basic HTAccess 301 Redirect Not a rule redirect

I want to redirect a ton of .html pages to a specific page of similar content (now managed with Wordpress).

So:

http://domain.com/page.html => 301 redirects too => http://domain.com/page/

I need the 301 redirect to work even开发者_如何学Go if the page.html file still exists in it's same position.


You can do this really easily with mod_rewrite. Something like:

RewriteEngine on
RewriteRule ^([^/]+)[.]html$ /$1/ [L,redirect=permanent]

If you'd rather do it one-by-one, you can use the Redirect directive instead.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜