开发者

Basic HTAccess 301 Redirect Not a rule redirect

开发者 https://www.devze.com 2023-04-04 12:17 出处:网络
I want to redirect a ton of .html pages to a specific page of similar content (now managed with Wordpress).

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

精彩评论

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