Roman Vybornov
Roman Vybornov

Reputation: 3

How to redirect URL's from old CMS to the new one? Need specific RewriteMatch directive

My old site was built on Joomla+Virtuemart engine, now i've created new one on Wordpress. My problem is Google's index - many visitors still coming by old URL's (http://example.com/component/virtuemart/123.html, etc). I want to make 301 Redirect on new site's frontpage (http://example.com), if user arrives from old URL, that contains this part:

/component/virtuemart/any_url

. I'm not very expirienced in regular expressions, so please help me to write working expression for my htaccess file.

Upvotes: 0

Views: 100

Answers (1)

Jerry
Jerry

Reputation: 71568

Using mod_alias, you might use:

RedirectMatch 301 ^/component/virtuemart.* http://mydomain.com/newaddress

Or using mod_rewrite:

RewriteEngine On
RewriteRule ^component/virtuemart.* /newaddress [L,R=301]

I based those on this answer.

Upvotes: 1

Related Questions