How to do a permanant redirect to another url in Joomla without using htaccess?

I am developing a custom extension and would like to redirect old/redundant urls to another one for better SEO. I can use htaccess for common things but in my case they are too many urls to set in htaccess.
Category: Components 6 years ago
Nagarjun
Asked 6 years ago
Nagarjun

Like it on Facebook, +1 on Google, Tweet it or share this question on other bookmarking websites.

You can use the following code to redirect permanently.

JFactory::getApplication()->redirect(JRoute::_($uri), '', 'message', true);

Replace $uri with the uri you would like to redirect to. For example,
'index.php?option=com_mycomponent&view=someview&task=sometask'.$itemid

Maverick
Answered 6 years ago
Maverick

Please register/login to answer this question.  Click here to login