|
htaccess and image dir redirection - Magento
Hi everyone,
Total noob here with pretty limited coding experience, so please bear with me!
We're in the process of switching our e-commerce software after using the same system for over 5 years. As such, the directories for our images will drastically change - and any images registered with search engines will eventually stop working. Thus, we require a bit of code that will redirect our old image directories.
Here's where it gets a bit more complicated. The new software (Magento) creates directories that reference the first and second letters (case-sensitive) of the image. For example, if you uploaded grayfox.jpg, Magento would do the following:
http://www.mysite.com/mag/media/catalog/product/g/r/grayfox.jpg
- note the /g/r/ directories
Using the same example, we would need a redirect of the following written in our htaccess file -
http://www.mysite.com/us/files/productdetails/grayfox.jpg
to
http://www.mysite.com/mag/media/catalog/product/g/r/grayfox.jpg
- where "g" dir is the first case-sensitive letter of the image filename and "r" directory is the second case-sensitive letter of the image filename
Can anyone help us with this problem? Much thanks in advance!
Last edited by HTMLBasicTutor; 06-01-2011 at 07:19 PM.
|