views:

160

answers:

2

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?

A: 

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

jlleblanc
I cnnot do that simply the old codebase does not exists and i need to keep the links already posted to some social net works and ads
Mithun P
No, you don't need the old script at all. Build a new script at `/search/commmission.cfm` to handle the old links and redirect.Otherwise, an Apache .htaccess file (with mod_rewrite on) will work.
jlleblanc
search/commmission.cfm Codfusion is not installed with the new server as it is a linux based.
Mithun P
+1  A: 

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.

Ben Doom
I use Apache, and i cannot modify CF script as it was in the old website and the new site is using PHP and Joomla
Mithun P
mod_rewrite is your answer, then. You need to do this at the web server level, not the application server.
Al Everett
Can anybody help be in writing the .htacess code and integrate this with joomla .htaccess file?
Mithun P