我如何表达一个301重定向,实际上是'任何其他'?换句话说,我有一个特定的页面列表重定向,但我只是希望任何没有明确重定向到主页
jei2mxaa1#
行:RewriteCond %{REQUEST_URI} !/$停止从根到根的无限重定向循环。
RewriteCond %{REQUEST_URI} !/$
RedirectMatch 301 ^pag1.html$ /new_pag1.html RedirectMatch 301 ^pag2.html$ /new_pag2.html RewriteEngine On RewriteCond %{REQUEST_URI} !/pag1.html$ RewriteCond %{REQUEST_URI} !/new_pag1.html$ RewriteCond %{REQUEST_URI} !/pag2.html$ RewriteCond %{REQUEST_URI} !/new_pag2.html$ RewriteCond %{REQUEST_URI} !/$ RewriteRule ^(.*)$ / [R=301,L]
1条答案
按热度按时间jei2mxaa1#
行:
RewriteCond %{REQUEST_URI} !/$
停止从根到根的无限重定向循环。