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 wor开发者_运维百科king, 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...
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
RewriteLog "log.txt"
RewriteLogLevel 9
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.
精彩评论