Redirect Issue – Fixing 301 Permanent Redirect in .htaccess

.htaccessredirect

I have following issue. I developing a new Magento store which data is imported from a old xt:Commerce store. The redirects in .htaccess works but xt:Commerce has URLs included with index.php and additional parameters.

For example:

Old URL: /index.php?cat=c484_Brandlbracke.html
New URL: http://www.anfalas.de/hundeaufkleber/rassehunde-a-c/brandlbracke.html

It works not with the URL index.php included. Have anyone an idea or way? I tried it also with default Magento URL Administration in Backend. I have only a list of thousands URLs as CSV.

Best Answer

In your .htaccess file, you could use the following format to redirect these old URLs:

RewriteCond %{QUERY_STRING} cat=c484_Brandlbracke.html
RewriteRule index.php http://www.anfalas.de/hundeaufkleber/rassehunde-a-c/brandlbracke.html? [R=301,L]

That should redirect the old index.php query string URLs to the new Magento format URLs. Make sure these redirects are higher up in the .htaccess file than the Magento main redirect.

Related Topic