3
我非常確定這是Apache配置中的一些問題,因爲它曾用於使用相同PHP/MySQL配置的以前的託管提供程序。在我的應用程序,用戶可以通過去的URI這樣來刪除照片:使用編碼參數請求URI時未找到404
http://example.com/my-account/remove-media/id/9/ret/my-account%252Fedit-album%252Fid%252F1
的paramater ID是一個照片的ID被刪除,參數RET是一個相對的URL,其中用戶後應重定向去除照片,但點擊一樣,我得到404 Not Found錯誤與文本的鏈接後:
Not Found
The requested URL /public/my-account/remove-media/id/9/ret/my-account/edit-album/id/1 was not found on this server.
儘管它曾經在我以前的託管服務提供商工作,所以我想這僅僅是一些簡單的Apache配置問題?
一件事,有一個htaccess文件,更改文檔根目錄/公用:
RewriteEngine On
RewriteRule ^\.htaccess$ - [F]
RewriteCond %{REQUEST_URI} =""
RewriteRule ^.*$ /public/index.php [NC,L]
RewriteCond %{REQUEST_URI} !^/public/.*$
RewriteRule ^(.*)$ /public/$1
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^.*$ - [NC,L]
RewriteRule ^public/.*$ /public/index.php [NC,L]
在公共文件夾中存在的MVC第二htaccess文件:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ /index.php [NC,L]
那麼,我會要求服務器管理員關閉它。修改應用程序太麻煩了。 – 2010-04-16 19:43:10
這是問題...我不得不重寫應用程序來使用:而不是/然後我只是在PHP中執行str_replace(':','/',$ requestVar)。 – 2010-04-17 19:09:19