【发布时间】:2014-10-18 18:54:26
【问题描述】:
当我浏览到 localhost/admin/videos/view/1 时,我得到了我想要的页面。我还希望在浏览到 localhost/videos/view/1 时显示该页面。
但它给了我错误信息:
HTTP Error 404.0 - Not Found
Detailed Error Information:
Module IIS Web Core
Notification MapRequestHandler
Handler StaticFile
Error Code 0x80070002
Requested URL http://{my-ip}/app/webroot/videos/view/1
Physical Path C:\inetpub\wwwroot\{my-project}\app\webroot\videos\view\1
Logon Method Anonymous
Logon User Anonymous
这些是我在 web.config 文件中的规则:
<rule name="Rewrite requests to test.php" stopProcessing="true">
<match url="^test.php(.*)$" ignoreCase="false" />
<action type="Rewrite" url="app/webroot/test.php{R:1}" />
</rule>
<rule name="Exclude direct access to app/webroot/*" stopProcessing="true">
<match url="^app/webroot/(.*)$" ignoreCase="false" />
<action type="None" />
</rule>
<rule name="Rewrite routed access to assets(img, css, files, js, fonts, vid, favicon)" stopProcessing="true">
<match url="^(img|css|files|js|fonts|vid|favicon.ico)(.*)$" />
<action type="Rewrite" url="app/webroot/{R:1}{R:2}" appendQueryString="false" />
</rule>
<rule name="Rewrite requested file/folder to index.php" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<action type="Rewrite" url="index.php" appendQueryString="true" />
</rule>
更新:
这有关系
<match url="^(img|css|files|js|fonts|vid|favicon.ico)(.*)$" />
当我剪掉视频时| (这是我的视频目录)它显示 localhost/videos/view/1。
但是我遇到的问题是它无法加载我的视频。
【问题讨论】:
标签: cakephp iis rewrite http-status-code-404