2014-03-07 54 views
0

试图让我的.htaccess条件工作,但他们似乎并没有正常工作,特别是第二组,我去除/ admin /目录 - 它保持陷入在第一组条件apache .htaccess rewritecond问题捕获所有管理请求

# If the request is either /admin/ or /admin/index.html, rewrite to just admin.html 
# http://foo.com/admin/ 
# http://foo.com/admin/index.html 
RewriteCond %{REQUEST_URI} ^/admin/$ [OR] 
RewriteCond %{REQUEST_URI} ^/admin/index\.html$ 
RewriteRule^admin.html [L] 

# if the request starts w/ /admin/, then remove the /admin folder and continue processing 
# http://foo.com/admin/bar/baz.css 
RewriteCond %{REQUEST_URI} ^/admin/.*$ 
RewriteRule ^/admin/(.*)$ /$1 

# if any resource is not a directory or file, then rewrite to the index.html 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule^index.html [L] 

这里是一个映射应该如何工作的所有

group one

group two

group three

回答

-1

为什么不消除第一一套规则,让第二套处理所有的管理重定向。那么在Apache中将admin.html设置为默认文件?