I want:
domain.com/example
to target:
domain.com/folder/example.cshtml
Can anyone help me with the rewrite rule for it?
Every suggestion is much appreciated :)
I have edited the question so that it actually focuses on what is important.
I want:
domain.com/example
to target:
domain.com/folder/example.cshtml
Can anyone help me with the rewrite rule for it?
Every suggestion is much appreciated :)
I have edited the question so that it actually focuses on what is important.
你为什么不使用mod-rewrite?
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
到根目录。