Redirect Joomla URLs (with index.php SEF links) to WordPress Multisite (subdomain setup)

I relaunched a website that was originally created with Joomla, now using WordPress for it (with subdomain multisite setup). The main domain remained the same.

Now I’m trying to redirect the old pages to the new ones via htaccess but it seems to cause a problem that the old URLs were formatted like “www.domain.com/index.php/de/oldpagename” because they seem to get stripped of index.php (and even the “/de/” oder “/en” parts) before the redirects are taking effect.

Read More

For example:

Redirect 301 /index.php/de/impressum http://de.domain.com/kontakt/

This leads to de.domain.com/impressum so the redirect is ignored but instead the URL is stripped of the index.php and there seems to be another redirect to the language subdomain based on the /de/ part.

I’m not very familiar with htaccess but my suspicion is that WordPress’ rewrite rules (and maybe a plugin – Multisite Language Switcher) are interfering here.

The only other code in the htaccess file is the WordPress part:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*.php)$ $1 [L]
RewriteRule . index.php [L]
</IfModule>

# END WordPress

I tried moving the redirects above the WordPress rewrite rules in the file and leaving out “/index.php” in the redirects with both making no difference at all. I also tried the Redirection plugin without success.

Does anyone have a solution for this?
I’ve been searching the web and Stockoverflow for hours now but everything that sounded promising didn’t match my scenario or involved dynamic Joomla URLs.

Thank you very much in advance!

Related posts