.htaccess regex help

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
nooysters
Forum Newbie
Posts: 1
Joined: Wed Nov 03, 2010 1:54 pm

.htaccess regex help

Post by nooysters »

I need to redirect the top url pattern to the bottom one for drupal:

original-> http://www.mydomain.com/store//images/P/VC0842_big.jpg
new-> http://dev.mydomain.com/sites/default/f ... 42_big.jpg

I tried this to no avail.
RewriteEngine on

RewriteCond %{HTTP_HOST}^.*/store//images/P/(.*)$ [NC]
RewriteRule ^.*/store//images/P/(.*)$ http://dev.mydomain.com/sites/default/f ... oduct/P/$1 [L,R=301]

anyone good with regex please help.
thanks in advance

UPDATE: this seems to work:)
RewriteBase /
RewriteRule ^(.*)store\/+images\/P\/(.*)$ sites/default/files/images/imagecache/product/P/$2 [L,R=301]
Post Reply