Image URLs and mod rewrite

Using mod_rewrite to handle various content issues

Image URLs and mod rewrite

Postby servantofgod » Sat Oct 04, 2008 7:44 am

I work for an e-commerce co. We have a site here:

We have product pages as: ... -70801.php

The product ID in that url is : Z4DJX-70801.php

If you go to the page you will see the product image. The image file name is: Z4DJX-70801.jpg

Is there a way that I can the product name to the image ID? So when google indexes the image it will also know what the image is instead of seeing a SKU?

For example: the image name would then be: MP4-Watch-2GB-Z4DJX-70801.jpg

This would have to work in a way that does not create thousands of broken image links...
Posts: 22
Joined: Wed Oct 01, 2008 8:14 am
Location: Chicago

Postby richardk » Sun Oct 05, 2008 10:56 am

Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^(.+/)?[^/]+-([a-z]+-[0-9]+\.jpg)$ /$1$2 [L]
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Return to Content

Who is online

Users browsing this forum: No registered users and 2 guests