我想:
domain.com/example
目標:
domain.com/folder/example.cshtml
IIS URL重寫錯誤404.0 [編輯]
誰能幫助我與它重寫規則?
的每一個建議是非常讚賞:)
我已經編輯了問題,所以它實際上側重於什麼是重要的。
我想:
domain.com/example
目標:
domain.com/folder/example.cshtml
IIS URL重寫錯誤404.0 [編輯]
誰能幫助我與它重寫規則?
的每一個建議是非常讚賞:)
我已經編輯了問題,所以它實際上側重於什麼是重要的。
爲什麼你不使用mod重寫?
RewriteCond %{THE_REQUEST} /folder/example.cshtml
RewriteRule ^$ /example.cshtml [R=301,L,NE]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^example.cshtml /folder/example.cshtml [L]
有時你需要更動斜線有點
我想這不能做我想要的方式。 我必須將example.cshtml
移動到根目錄。
對不起,我忘了你在.net上。我認爲這個問題不是重寫問題,而是與您如何配置與example.cshtml關聯的視圖有關。 – Dave 2013-02-24 13:36:36
從瀏覽器打到'domain.com/example.cshtml'時,你有404嗎? – cheesemacfly 2013-02-24 17:18:58
@cheesemacfly是的,儘管我在錯誤的方向思考,反之亦然。但問題中的代碼沒有意義。 – Nikita 2013-02-24 17:28:53
是的,我想你應該先修復你的404錯誤然後:) – cheesemacfly 2013-02-24 17:29:46