2014-03-07 103 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設置爲默認文件?