Forum Moderators: open

Message Too Old, No Replies

Classic ASP URL rewriting

         

indigojo

5:10 am on Sep 8, 2008 (gmt 0)

10+ Year Member



Can anyone offer some advice on URL rewriting on IIS 6, the best way to go etc. Ideally I'd like a coded solution not an IIS plug in.

We specifically want to turn URLS like this

/articleID=3456

to

/A_Page_Name

where "page Name" is stored in the database as "A_Page_Name" already.

Does anyone know if this would be possible with just classic ASP code?

pavlovapete

5:30 am on Sep 8, 2008 (gmt 0)

10+ Year Member



Hi indigojo,

you can do this with 404 rewriting without the ISAPI filter or similar.

You'll need to point your 404 page in IIS to a script eg rewrite.asp. Then in rewrite.asp do a database lookup on the requested url (articleID=3456), pull your content and redirect (maybe with a 301 header).

Please note I've only done this with php on IIS and not classic asp. However I think the theory should hold. Googling for IIS custom 404 redirect may provide some further advice.

HTH

Cheers

mrMister

10:47 am on Sep 8, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I used to mess around with (mis)using the dynamic 404 pages, but eventually I switched over to ISAPI_Rewrite and never looked back. It's much quicker and easier to use and adapt as your needs change. If you only have one website, you can use the free version of ISAPI_Rewrite.

indigojo

11:46 am on Sep 8, 2008 (gmt 0)

10+ Year Member



thanks pavlovapete, we will give this a go.

carguy84

4:55 pm on Sep 8, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



ISAPI_rewrite is definitely the industry standard. We've been using it since 2001 and is lightning quick. We've only noticed a performance impact when load testing at about 360 requests per second(about 300 more per second than we get :)). But it was good to know it scales!

chewy

11:25 pm on Nov 6, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



great to see the product name mentioned here to solve an otherwise nasty problem.

- any concerns about security or other downsides when dealing with this product?

carguy84

5:23 am on Nov 9, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Security, no, haven't run into any security issues.

Downsides to it only really happen when using .NET and postbacks, but it's an easy fix once you got the code for it.

Support is really good on their forums, and it's easy to install and understand.