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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

any way to swap query strings for /article/113 in URL? 1

Status
Not open for further replies.

xor

Programmer
Jan 7, 2001
71
NZ
I've posted this question but no replies yet, so I thought I would post again with a different subject in case that is a bit clearer.

I've heard these referred to as 'clean' URLs. Basically the idea is to get rid of the filename?querystring combination and replace it with what look like folder paths ( Because the webserver by default tries to execute this as a folder path I need to find a way to override that behaviour and execute the index.cfm page instead which will parse the path and extract the URL variables being passed (disguised as folder paths).

To put it more simply, I need to set a website up to handle what looks like a folder path and call a specific file, passing the folder path. That probably sounds more complicated than it is. Let me give an example:

If passed a URL such as:

I want IIS to call the file index.cfm, which will parse out the '/article/11357' bit and run the appropriate programming logic on it.

I have read an article about how to do that using apache and php, but I need to use IIS (and ColdFusion -- that's the easy bit). Apache has a function called 'ForceType' which tells it "look, anything with 'article' in the path, treat it like a php file" (or coldfusion or whatever type), and then presumably the default page (index.php or whatever) is called and that's where you put your programming logic to extract the data from the 'article/11357' bit)

Any ideas or suggestions, even if they take a different approach would be welcome.

The New Zeal The New Zealand Site
 
Try this.

If you URL and there is no folder /article/11357 IIS will throw a 404. Use index.chm as a custom 404 page. If this page has access to the http-referrer then you have a solution.

Rob W
If you feel this post has ben helpful then award me a star dammit!
 
Thanks Rob
I ended up doing what you suggested just the night before you posted (well, my time anyway), and it certainly did the trick. I actually tried a number of things that didn't work in the end, but co-opting the 404 error page worked beautifully!

So I gave you a star dammit ;)

Thanks again for your helpful post! The New Zealand Site
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top