Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Regex 如何不重定向谷歌网站管理员工具验证程序_Regex_.htaccess_Google Webmaster Tools - Fatal编程技术网

Regex 如何不重定向谷歌网站管理员工具验证程序

Regex 如何不重定向谷歌网站管理员工具验证程序,regex,.htaccess,google-webmaster-tools,Regex,.htaccess,Google Webmaster Tools,我在.htaccess中使用以下重写规则: RewriteRule ^(.*)\.html$ /index.php?show=$1 [QSA,L] 现在我已经注册了GoogleWebmasterTools,它通过请求一个名为Google(someSerialNumber).html的文档,大约每月尝试验证一次网站所有权。但是因为我的重写规则,它被重新修改,验证失败,所以我不得不在手动验证时临时删除规则,这让我很恼火 正确的正则表达式如何重写除验证文档之外的所有内容?您可以尝试使用负前瞻: ^(

我在.htaccess中使用以下重写规则:

RewriteRule ^(.*)\.html$ /index.php?show=$1 [QSA,L]
现在我已经注册了GoogleWebmasterTools,它通过请求一个名为
Google(someSerialNumber).html
的文档,大约每月尝试验证一次网站所有权。但是因为我的重写规则,它被重新修改,验证失败,所以我不得不在手动验证时临时删除规则,这让我很恼火


正确的正则表达式如何重写除验证文档之外的所有内容?

您可以尝试使用负前瞻:

^(?!google\([^\)]+\)\.html$)(.*)\.html$
如果只有一个序列号,只需将其放入正则表达式中,而不是
[^\)]+

正则表达式将不匹配
google(someSerialNumber).html,因为前面是负数