views:

15

answers:

1

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...

+1  A: 

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.

Nick Berardi
Where should the txt file go, should it be referenced in the web.config? And what exactly should go in the txt file, is there any documentation on this? When I've seen examples of the txt, they looked quite complex. I'm on IIS7.5 btw.
alchemical
Also for the web config you say "at least the following" - is there any way I can read up on this to more fully understand what could/should go there?
alchemical
I tried the logging and no log appeared in the web root. Also, I'm currently debugging with VS2010.
alchemical
ok, I got it working now. It seems to make a slight change somehow to my CSS which is affecting page formatting...
alchemical
looks like its inadvertently rewriting my css file name: 2010-10-22T09:50:40 [Rewrite] Input: http://localhost:62502/find/pv.css2010-10-22T09:50:40 [Rule 0] Input: /find/pv.css2010-10-22T09:50:40 [Rule 0] Rule Pattern Matched2010-10-22T09:50:40 [Rule 0] Output: /index.aspx?k=pv.css2010-10-22T09:50:40 [Rewrite] Output: http://localhost:62502/index.aspx?k=pv.css
alchemical
alchemical