Reputation: 797
An image gallery has 120,000 images. I want to change URL such as this:
/album_mod/upload/8c3d534a1451c87aca1fa710be6be8.jpg
to this, using a 301 redirect with a .htaccess file:
/image/gallery/category-a8/imagename-i6282.jpg
However, my problem is that the original URL has no ID in the URL. My idea is to:
/image/gallery/category-a8/imagename-i6282.jpg
In this way I have two 301 redirects. Is there a better way?
Upvotes: 0
Views: 748
Reputation: 18671
You can do invisible rewrite to .php
with this .htaccess
:
RewriteEngine on
RewriteRule ^album_mod/upload/(.+)\.jpg$ /redirect/index.php?file=$1 [L]
And after that you can do only one 301 redirect, with the right new name.
Upvotes: 2