Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/18.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 Mod_rewrite-拒绝特定页面以外的访问_Regex_Apache_.htaccess_Mod Rewrite - Fatal编程技术网

Regex Mod_rewrite-拒绝特定页面以外的访问

Regex Mod_rewrite-拒绝特定页面以外的访问,regex,apache,.htaccess,mod-rewrite,Regex,Apache,.htaccess,Mod Rewrite,有一个重写规则,可以将不在办公室的任何人重定向到保留页 RewriteEngine On RewriteCond %{REMOTE_ADDR} !^x\.x\.x\.x$ RewriteRule . holdingpage.html RewriteCond %{REMOTE_ADDR} ^x\.x\.x\.x$ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . index

有一个重写规则,可以将不在办公室的任何人重定向到保留页

RewriteEngine On

RewriteCond %{REMOTE_ADDR} !^x\.x\.x\.x$
RewriteRule . holdingpage.html

RewriteCond %{REMOTE_ADDR} ^x\.x\.x\.x$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [NC,L] 
我需要允许google访问其google验证文件:

是否有方法添加重写,以允许办公室以外的任何人访问此页面,以及在访问任何其他页面时重定向到保留页面

非常感谢,

是的,您一定能做到:

RewriteEngine On

# If request is for special page, skip all rules below
RewriteRule ^google23423423463\.html$ - [L]

RewriteCond %{REMOTE_ADDR} !^x\.x\.x\.x$
RewriteRule . holdingpage.html [L]

RewriteCond %{REMOTE_ADDR} ^x\.x\.x\.x$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
是的,你肯定能做到:

RewriteEngine On

# If request is for special page, skip all rules below
RewriteRule ^google23423423463\.html$ - [L]

RewriteCond %{REMOTE_ADDR} !^x\.x\.x\.x$
RewriteRule . holdingpage.html [L]

RewriteCond %{REMOTE_ADDR} ^x\.x\.x\.x$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]

Spot on,正是我所需要的。谢谢,没错,这正是我需要的。谢谢