php - 使用 .htaccess 向 googleverifcation 文件添加异常(exception)

标签 php .htaccess codeigniter seo

最近我删除了我们网站中的所有 .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/

相关文章:

apache - 500 错误,但没有有关链接 GET/HTTP/1 的信息。 1"500 "-”

php - 如何防止codeigniter创建Memcache目录

php - 如何使用 codeigniter 使用其各自的数据从 a-z 进行分页

php - 设置配置项 (csrf) 在 Codeigniter 中不起作用

javascript - 在另一个文件中追加数据

php - 在哪里放置 include/require 语句?

php - SQLSTATE[23000] : Integrity constraint violation: 1048 Column 'property_id' cannot be null in Laravel 5. 2

php - 如何读取两个html标签之间的数据作为文本

apache - 将所有 Apache 2.2 403 Forbidden 重定向到 404 Not Found

php - Apache : How to Use Rewrite Engine Inside Alias