【发布时间】:2013-12-05 20:28:21
【问题描述】:
我需要将域的所有页面重定向到名为“紧急”的子页面。
但是忽略两个特定页面——“紧急”页面本身和另一个称为“系统”的页面。
我目前有:
AcceptPathInfo On
Options -Indexes
RewriteEngine On
RewriteBase /
RewriteCond %{REMOTE_ADDR} !^111\.111\.111\.111
RewriteCond %{REQUEST_URI} !^/(emergency|system)/?$ [NC]
RewriteRule ^ /emergency? [L,R=301]
RewriteCond $1 !^(index\.php|assets|robots\.txt|cgi-bin|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^/index.php
RewriteCond $1 !.(css|js|png|jpe?g|gif|ico)$ [NC]
RewriteRule ^(.*)$ /index.php?/$1 [L]
这不起作用。
我已经看过了,但也没有任何效果:
- Apache redirect all sub pages to home page except specific pages
- .htaccess 301 redirect that excludes a subpage
任何帮助将不胜感激!
谢谢!
【问题讨论】:
标签: php regex apache .htaccess mod-rewrite