Managed Fusion Url Rewriter - 如何安装、基础工作
我想尝试一下,下载它,阅读自述文件,引用 dll,编辑 web.config。
除了自述文件之外,我找不到任何文档似乎有很多东西需要知道才能让它发挥作用……所以,我一直在黑暗中摸索。我设置了一个 txt 文件,不知道该把它放在哪里,所以把它放在 web 根目录和 bin 文件夹中。以下是它现在包含的内容:
RewriteEngine On
RewriteRule ^/find/(.*) /index.aspx?k=$1 [NC,L]
我尝试构建和查看该站点,并尝试使用 find/stuff 语法来获取 URL,但收到 404 错误。我将不胜感激任何有关如何使其发挥作用的建议!
更新:一旦我让它基本工作起来,我意识到 css 和图像文件等的所有路径都需要重写为绝对路径。我仍在尝试弄清楚如何将 ASP.Net 表单发布到绝对路径,这样它就不会发布回重写的 URL...
I'd like to try this out, downloaded it , read the readme, referenced the dll, edited the web.config.
I couldn't find any documentation besides the readme, and it seems that there is a lot to know to get it to work...so, I've been kind of grasping in the dark. I set-up a txt file, didn't know where to put it so dropped it in both the web root and the bin folders. Here is what it now contains:
RewriteEngine On
RewriteRule ^/find/(.*) /index.aspx?k=$1 [NC,L]
I tried building and viewing the site, and tried out the URL with the find/stuff syntax, but I get a 404 error. I would appreciate any advice on how to get this working!
UPDATE: Once I got it basically working, I realized all paths to css and image files, etc., need to be rewritten to absolute paths. I'm still trying to figure out how to have the ASP.Net form post to an absolute path, so that it doesn't post back to the rewritten URL...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于 IIS 6 和 7 之间的脱节,这将是一个多决策树排序过程。
第 1 步
无论您使用哪个版本的 IIS,请确保您的
web.config< /code> 至少有以下配置:
http ://github.com/managementfusion/managedfusion-rewriter/blob/master/Tests/WebApplication/Web.config
第 2 步
接下来,如果您使用的是 IIS 6,请确保启用通配符如自述文件第 3 部分中所述。 这一步非常重要,如果你跳过这 90% 的人说他们阅读了自述文件,那么什么都不起作用
否则,如果你使用 IIS 7,请确保将 AppPool 设置为使用集成模式而不是经典模式模式。
第 3 步
如果之后一切仍然不起作用,请尝试通过在
RewriteEngine On
下添加以下内容来启用日志记录,这将在应用程序的根目录中生成一个日志文件。如果此日志中显示任何内容,则表明重写引擎正在工作,您只需调整规则即可。
This is going to be a multi-decision tree sort of process because of the disconnect between IIS 6 and 7.
Step 1
No matter what version of IIS you use make sure your
web.config
at least has the following configuration in it:http://github.com/managedfusion/managedfusion-rewriter/blob/master/Tests/WebApplication/Web.config
Step 2
Next if you are using IIS 6 make sure that wildcards are enabled as outlined in part 3 of the readme. This step is very important, if you skip which 90% of people do who said they read the README nothing will work
Else if you are using IIS 7 make sure the AppPool is setup to use Integrated mode not Classic mode.
Step 3
If everything still doesn't work after that try enabling logging by adding the following right under
RewriteEngine On
This will produce a log file in the root directory of your application. If anything shows up in this log the rewrite engine is working, you just need to tweak your rules.