I have a small system (Coldfusion8, MySQL 5.0.88), which allows users to skin the main website depending on their prefrences.
This works all well, except for the URL still being ugly like so:
www.my_site.com/index.cfm?user=123456789
I now want users to have their own URL displayed and have read into vhost (I’m running Apache) on how to do this. I’m changing skins depending on the id provided in the URL. If I now setup my system to display:
wwww.users_selected_url.com
versus the above, I will have no way to check for the URL ID. I’m using this ID check a fair bit throughout the application to customize the page layout when rendering the page with Coldfusion.
Question:
When will the URL be reformatted? Will the page being loaded still be requested with the original URL, so Coldfusion can do it’s stuff and only the page displayed to the user will be with his customized URL? How about if I also use URL-rewriting?
Thanks for some info!
You need to have a vhost setup to accept requests for the
wwww.users_selected_url.comhost, and the DNS needs to point to your server. In the vhost config, you can use the rewrite module to change the URL to/index.cfm?user=123456789, and this rewriting happens before the URI is handed off to cold fusion. You need to add this to your vhost config:This uses mod_proxy to proxy the request to
http://www.my_site.com/index.cfm?user=123456789when someone goes tohttp://www.users_selected_url.com/in their browser.