Martin Myška Martin Myška - 1 year ago 91
PHP Question

.htaccess redirect from old Joomla to Wordpress

im in trouble with redirect from my old Joomla to newer Wordpress site.
Website site is for example, but when i want to load this old URL from Joomla

Wordpress shows me 404 error, how can i redirect it so new URL will be

I want to redirect more sites, so its little bit harder, i need just to remove category (bydleni-a-zahrada) and first numbers after "/" with "-".
That is all

My .htaccess file looks this:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

Answer Source

You can use this redirect rule as your very first rule:

RedirectMatch 301 ^/[^/]+/\d+-(.+)$ /$1
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download