I need to keep my old coldfusion links in my new joolma site. I need to add a redirect mechanism in joomla like All urls like /search/commission.cfm?commID=456?t=2 should redirect to /sale?id=456 How can i do this?
If you can replace the script at /search/commission.cfm
, the best strategy would be to have this script do the redirection through ColdFusion's <cflocation>
tag: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/tags-p70.htm
Extract the value of commID
, make sure it is an integer, construct your Joomla URL using that ID, then redirect.
If you have to leave the old script as-is, you should be able to use a RewriteRule
in your .htaccess file to match ^search/commission.cfm?commID=.*
and redirect to sale?id=$1
There are at least two options.
You could use something like mod_rewrite on Apache or one of many plugins for IIS to do a URL rewrite before the webserver request is processed. This is probably more efficient from a machine point of view, and does not require a CF install.
You could also write a CF script to catch and handle 404 errors, processing the URL requested and redirecting to the appropriate new URL. This probably uses tech and skills you already have.
If you clarify the situation a bit, you might get better answers.
Edit: Based on your comments (and general consensus) using mod_rewrite for Apache is probably your best bet. There are lots of resources to help you with that, both on this site and the web in general. I would suggest that if you have specific questions about it, you ask them over on Server Fault.