Quantcast
Channel: Adobe Community: Message List - ColdFusion
Viewing all articles
Browse latest Browse all 21760

Re: Alias URLS based on directory - Redirect

$
0
0

Depending on the tech you have available, I would use URL Rewriting.  This allows the URL to stay fresh as well.

 

When a user requests:

 

http://www.mydomain.com/websiteNumber/page.cfm

 

Initially it's handed off to the webserver (assuming IIS7)  IIS can then intercept the request and rewrite it before it is passed on for processing.

 

The above request looks like this to IIS BEFORE URL Rewriting:

 

/websiteNumber/page.cfm

 

After the rule is applied, the request will look like:

 

/usersites/websiteNumber/page.cfm (even though the URL will remain the same)

 

At that point, once URL rewriting is done, IIS will process the request by looking into the root directory to see if there is a usersites folder, and a websiteNumber folder in that, and then a page.cfm.  And if there is, it sees that the .CFM extension means to hand the request off to ColdFusion, which then process the .cfm page under the belief that the requested URL is '/usersites/websiteNumber/page.cfm'.

 

The only thing to be mindful of is that if an error occurs, it may expose the path.


Viewing all articles
Browse latest Browse all 21760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>