Ad

What's Wrong With This Htaccess Redirect?

- 1 answer

I recently turned an old Joomla site into a Wordpress site and I want to redirect the old urls to the correct new ones. For starters I tried to redirect them all to the homepage but even that didnt work.

All the old urls look like website.com/?q=node/1 (or sometimes ?q=user/ etc), so I figured this would be enough:

RewriteCond %{QUERY_STRING} ^q=(.*)
RewriteRule . /home/ [R=301]

Why doesn't this work?

Ad

Answer

[EDIT - FINAL SOLUTION - see comments]

RewriteCond %{QUERY_STRING} q=
RewriteRule (.*) lexlijst.nl/$1? [L,R=301]
Ad
source: stackoverflow.com
Ad