我想重写所有不以wp-content开头但以.html结尾的内容。我的尝试失败:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/wp-content.*
RewriteRule ^(.*)\.html /$1-pages/ [R=301,L]
答案 0 :(得分:1)
您在这里不需要RewriteCond
。只需将下一条规则修改为:
RewriteRule ^/?(?!wp-content/)(.*)\.html$ /$1-pages/ [R=301,L]
我用否定的前瞻来否定结果。