Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By tl_astk on
for our product images...
I need to redirect the top url pattern to the bottom one for drupal:
original-> http://www.mydomain.com/store//images/P/image.jpg
new-> http://dev.mydomain.com/sites/default/files/images/imagecache/product/P/...
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/files/images/imagecache/product/P/$1 [L,R=301]
anyone good with regex please help.
thanks in advance
Comments
The problem is: you're trying
The problem is: you're trying to match a URI in the HTTP_HOST - You need to match against the REQUEST_URI
This should do what you want: