Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Programming URL redirect in IIS 1

Status
Not open for further replies.

sharedworld

Programmer
Dec 25, 2003
65
US
Hello,

I'm looking for a way that when my customers are clicking on it should redirect they automaticly to
I don't want to do it by creating a folder named downloads (manually or with fso) because I have a lot of redirection that I need and I don't want 200 folders on my root folder...

I thought on using ISAPI_Rewrite from HeliconTech.com, and then use a RewriteRule to actually rewrite the url (here is the syntax: RewriteRule /customer12/? /index.asp?\?customer=12 [I,R])

This is working for me, and the settings file is a ini file, so I'm editing it with fso, but the problem is that if I have a folder named customer12 on the root, IIS will ignore it because of the ISAPI_Rewrite filter. So I'm looking for an another way of someone has ideas please share it...

Thanks
 
You could build some functionality into your 404 Not Found page so that when someone tries to access a certain URL like /customer12, they are redirected to /index.asp?customer=12. You'll end up with a lot of 404 errors in your log, but this is a quick and easy to way to get it done. Let me know if this makes sense; I'm feeling a little incoherent today.

Misty
 
That's how I've done it before... catch it on the 404 and redirect as necessary.

It doesn't solve your problem of "what if there's a real directory with that name," but I don't know how you'd ever solve that, as how would you know what the user intended if the directory name was valid?
 
thanks myatia, that's what i'm working on... btw I found another solution too by creating virtual folders redirecting to an url, but your solution is the best. thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top