0

i replaced an old Joomla! Site with a new one and want to redirect selected old URLs to their appropriate new ones. The old Joomla! Site uses URLs like example.com/index.php/news or example.com/index.php/about and the new Site uses URLs like example.com/latest-news.html or example.com/about-us.html. Simple redirects using RedirectPermanent in .htaccess does not work (probably because the part after the slash is a query string, no URL segment). I searched the web but didn't found an answer.

Any suggestions?

Thanks in advance.

  • "probably because the part after the slash is a query string" - What you've shown in your question is not a query string, that is additional _path information_ and is normally considered part of the URL path. Please include what you have already tried in your question. Also, add your existing `.htaccess` file, since there is quite probably a conflict with existing directives. – MrWhite Jan 04 '17 at 14:25

1 Answers1

1

The following should work:

Redirect 301 /index.php/news http://example.com/latest-news.html

For query strings, did you look at similar post htaccess 301 redirect for URL with parameter

Community
  • 1
  • 1
Sandeep
  • 130
  • 1
  • 7
  • If you specify the domain in the target URL then you'll need to make it an absolute URL with scheme. (Or use a root-relative path) – MrWhite Jan 04 '17 at 15:05
  • Oh yes! I tried this before without success but now it is working. And so simple. Thank you very much! – digitalbricks Jan 04 '17 at 16:17