Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Jul 2008
    Posts
    155
    Plugin Contributions
    0

    Default How to redirect image URL?

    I have put all images under store/images directory without making subdirectories.

    However, my hosting just warned me to restructure the directories so that I will not have more than 1024 files in 1 directory. Otherwise my hosting account will be suspended.

    My image files are named systematically, and I believe I can redirect the images easily by .htaccess

    for example:

    the original path is:
    images/AAA001.jpg

    I want to make it redirect to:
    images/AAA/AAA001.jpg

    and of course I want this rule to apply to:
    AAA001-AAA999
    BBB001-BBB999
    CCC001-CCC999
    ...
    ...

    I need the rule to search for the first few characters of the file, if it returns AAA, then redirect it to images/AAA/AAAxxx.jpg


    How should I write the .htaccess?

    Thanks in advance!

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: How to redirect image URL?

    Just move them and repoint them through the product setup screen in the admin
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Jul 2008
    Posts
    155
    Plugin Contributions
    0

    Default Re: How to redirect image URL?

    Quote Originally Posted by kobra View Post
    Just move them and repoint them through the product setup screen in the admin
    Thanks for your reply.

    However, I have over thousand products and I cannot afford to repoint the image files one by one.

    Is there any faster method? I believe htaccess can help rewrite or redirect.

    Anyone is familiar about it?

    thanks!

  4. #4
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: How to redirect image URL?

    Is there any faster method?
    Some use easy populate for these things
    Zen-Venom Get Bitten

  5. #5
    Join Date
    Sep 2005
    Location
    Waikato, New Zealand
    Posts
    1,539
    Plugin Contributions
    3

    Default Re: How to redirect image URL?

    I had to do a similar thing

    I just moved all the products imaages starting with aa to images/aa

    Then ran a script on the database

    Basically finding every instance of "images/aa" in the image field of the product table and replacing it with images/aa/aa

    although i did test the script on a copy of the database running on my local wamp server
    Webzings Design
    Semi retired from Web Design

 

 

Similar Threads

  1. v139h How to redirect a product url to sub.domain?
    By hara in forum General Questions
    Replies: 15
    Last Post: 1 Jun 2016, 12:45 AM
  2. How to redirect my links (Simple SEO url)
    By vivek_advsol in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 23 Jun 2010, 01:10 AM
  3. How to change expresscart redirect URL
    By eddyboy in forum PayPal Express Checkout support
    Replies: 1
    Last Post: 5 Mar 2009, 02:41 PM
  4. How to redirect index URL
    By james739 in forum General Questions
    Replies: 4
    Last Post: 4 Jul 2008, 05:19 PM
  5. Help! How to Redirect Multiple URLs to Homepage URL?
    By Stenrique in forum General Questions
    Replies: 0
    Last Post: 11 Jul 2007, 05:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg