Htaccess redirect moved articles to subdomain

42 Views Asked by At

I have moved a Drupal site to a subdomain archive but I still want old links to work. For example:

http://example.com/cs/clanek/article-name
should redirect to
http://archive.example.com/cs/article-name

I've tried numerous attempts and so far, but I only have a redirect to "www.archive". I want non-www without the rest (cs/clanek).

So far, I have the following code but it redirects to "www.example.com", which doesn't work because I need it without "www".

RewriteEngine on
RewriteCond %{HTTP_HOST} !^pravapraha\.cz$ [NC]
RewriteRule ^(.*)cs/clanek(.*)$ archive.pravapraha.cz/$ [R=301,L]

What am I doing wrong?

0

There are 0 best solutions below