【问题标题】:Add exception to googleverifcation file using .htaccess使用 .htaccess 向 googleverifcation 文件添加例外
【发布时间】:2013-08-23 11:17:20
【问题描述】:

最近我删除了我们网站中的所有 .html 扩展名 使用 htaccess
这是我的代码:

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ (/[^\ ]+)\.html\  [NC]
RewriteRule ^ %1 [L,R=301]

我在向其中添加异常时遇到问题。
我想允许这个文件

google4fa5440fdd1877e2.html

我非常需要您的意见。提前致谢。

【问题讨论】:

    标签: php .htaccess codeigniter seo


    【解决方案1】:

    用这个替换你的规则:

    RewriteCond %{REQUEST_FILENAME} !google4fa5440fdd1877e2\.html [NC]
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ (/[^.]+)\.html\  [NC]
    RewriteRule ^ %1 [L,R=301]
    

    【讨论】:

    • 不客气,很高兴它对你有用。请尽可能接受答案。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-05-26
    • 1970-01-01
    • 1970-01-01
    • 2012-10-23
    • 1970-01-01
    • 1970-01-01
    • 2014-04-24
    相关资源
    最近更新 更多