htaccess stop processing rules
I need to be able to run the rule开发者_运维知识库s at CakePHP block if my IP matches the Maintenance Mode conditions otherwise ignore them, possible? Thanks.
RewriteEngine on
# Maintenance Mode
RewriteCond %{REQUEST_URI} !/offline\.php$
RewriteCond %{REMOTE_ADDR} !^(00\.00\.00\.00)
RewriteRule .* /offline\.php [L]
# CakePHP
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
Yes, that is possible:
RewriteEngine on
# Maintenance Mode
RewriteRule ^offline\.php$ - [L]
RewriteCond %{REQUEST_URI} !^/offline\.php$
RewriteCond %{REMOTE_ADDR} !=192.168.0.2
RewriteRule .* /offline.php [L]
# CakePHP
RewriteRule ^$ app/webroot/ [L]
RewriteCond %{REQUEST_URI} !^/app/webroot/
RewriteRule (.*) app/webroot/$1 [L]
Use your own IP address
I have added condition to the very last rule to prevent rewrite loop
精彩评论