最近我删除了我们网站中的所有 .html 扩展名
使用 htaccess
这是我的代码:
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ (/[^\ ]+)\.html\ [NC]
RewriteRule ^ %1 [L,R=301]
我在向其中添加异常时遇到问题。
我想允许这个文件
google4fa5440fdd1877e2.html
我非常需要您的意见。提前致谢。
最佳答案
用这个替换你的规则:
RewriteCond %{REQUEST_FILENAME} !google4fa5440fdd1877e2\.html [NC]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ (/[^.]+)\.html\ [NC]
RewriteRule ^ %1 [L,R=301]
关于php - 使用 .htaccess 向 googleverifcation 文件添加异常(exception),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18351418/