2

I'm running into an issue where 301 redirects on site I switched from Joomla to EE are not working. The link style on the old version of the site is:

http://example.com/index.php?option=com_user&view=reset&Itemid=14

For the redirect, I'm using this line in the .htaccess:

Redirect 301 /index.php?option=com_user&view=reset&Itemid=14 /contact

Since index.php is valid with EE, my assumption is the issue revolves around the query string since a more basic redirect works as indended:

Redirect 301 /about /

routes traffic from the about page to the home page.

How can I redirect these links to the new ExpressionEngine-powered pages or, if the issue is more generic, links containing "index.php?"?

3

You need to use %{QUERY_STRING}

RewriteCond %{QUERY_STRING} ^option=com_user&view=reset&Itemid=14$
RewriteRule ^(.*) /contact? [L,R=301]
| improve this answer | |
  • That was 99.99998% there! It should be /contact? [L,R=301] otherwise the option=... bit is appended to the redirected URL. – Brooks Seymore Jun 15 '14 at 5:18
  • Thanks for your help, Max! Not quite wrapping my head around the ? being necessary... my understanding is that means what directly proceeds it can be optional but in this case, it seems to impact what comes after? – Brooks Seymore Jun 15 '14 at 19:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.