1
我們使用符號鏈接來跨多個站點共享各種資產,並且最近注意到我們的apache錯誤日誌包含以下大量內容;apache/.htaccess符號鏈接循環
由於可能的配置錯誤,請求超過了10個內部重定向的限制。
下面是完整的。htaccess的;
Options -Indexes
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /site/assets/sym/$1 [L]
apache手冊警告[L]標籤的限制;
是很重要的,如果你正在使用的RewriteRule指令在這些上下文之一,>您採取明確的步驟,以避免規則循環,而不是在[L]標誌僅數到>終止的執行一系列的規則,如下所示。 (http://httpd.apache.org/docs/current/rewrite/flags.html#flag_l)
我想知道是否需要添加一個[NS]標記或可能另一個RewriteRule? - 任何幫助非常感謝!
ps。從日誌的進一步細節,而是強調我這是一個sym問題?...
[Fri Sep 30 10:38:59 2011] [debug] core.c(3083): [client someIP] r->uri = /site/assets/sym/sym/sym/sym/sym/sym/sym/sym/sym/sym/template/css/default.css
[Fri Sep 30 10:38:59 2011] [debug] core.c(3089): [client someIP] redirected from r->uri = /site/assets/sym/sym/sym/sym/sym/sym/sym/sym/sym/template/css/default.css
[Fri Sep 30 10:38:59 2011] [debug] core.c(3089): [client someIP] redirected from r->uri = /site/assets/sym/sym/sym/sym/sym/sym/sym/sym/template/css/default.css
[Fri Sep 30 10:38:59 2011] [debug] core.c(3089): [client someIP] redirected from r->uri = /site/assets/sym/sym/sym/sym/sym/sym/sym/template/css/default.css
[Fri Sep 30 10:38:59 2011] [debug] core.c(3089): [client someIP] redirected from r->uri = /site/assets/sym/sym/sym/sym/sym/sym/template/css/default.css
[Fri Sep 30 10:38:59 2011] [debug] core.c(3089): [client someIP] redirected from r->uri = /site/assets/sym/sym/sym/sym/sym/template/css/default.css
[Fri Sep 30 10:38:59 2011] [debug] core.c(3089): [client someIP] redirected from r->uri = /site/assets/sym/sym/sym/sym/template/css/default.css
[Fri Sep 30 10:38:59 2011] [debug] core.c(3089): [client someIP] redirected from r->uri = /site/assets/sym/sym/sym/template/css/default.css
[Fri Sep 30 10:38:59 2011] [debug] core.c(3089): [client someIP] redirected from r->uri = /site/assets/sym/sym/template/css/default.css
[Fri Sep 30 10:38:59 2011] [debug] core.c(3089): [client someIP] redirected from r->uri = /site/assets/sym/template/css/default.css
[Fri Sep 30 10:38:59 2011] [debug] core.c(3089): [client someIP] redirected from r->uri = /site/assets/template/css/default.css
[Fri Sep 30 10:38:59 2011] [error] [client someIP] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
pps。它正在尋找的文件不存在,所以也許這個問題需要改寫爲'我怎樣才能修改這個htaccess文件,以便在退出之前只嘗試一次符號鏈接的directoy' - 這會更簡潔一點,是吧?!
RewriteCond%{REQUEST_URI}!^/site/assets/sym似乎覆蓋了它:-) - 希望這可以幫助其他人使用累了的服務器! –