0
我有一個.htaccess文件,看起來像這樣。我想要做的是將請求傳遞到index.php,如果文件或目錄存在,並且生成403錯誤。mod_rewrite on 403 error
也就是說,如果服務器上存在「/ foo/bar」,但生成了403,我希望將「/ foo/bar」傳遞到index.php上,就好像目錄「/ foo/bar」doesn' t存在於服務器上。
可能嗎?
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase/
#Make sure the physical file doesn't exist
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
是否有可能通過mod-rewrite將所有查詢和url信息傳遞給ErrorDocument?似乎沒有在文檔中。 – mbond
我......假設你並沒有[閱讀](http://httpd.apache.org/docs/2.2/custom-error.html)他們...... –
只需添加「ErrorDocument 403 /index.php「處理這種情況。 – mbond