Announcement

Collapse
No announcement yet.

Adding rule to htaccess file to rewrite or redirect filename

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Adding rule to htaccess file to rewrite or redirect filename

    Good Morning,

    I have an optimizer on our MIVA store and with the changes to the store, what used to produce links for me in this format:


    http://www.***********.com/product/S_GMD_1_DIG-DLD-zip.html


    Is now updating to...


    http://www.***********.com/product/S_GMD_1_DIG-DLD.zip.html (change is “.zip.html)


    The problem is that when I update the page, it updates the new link, but leaves the old one alone. I can get to those old static html files and place redirects on them, however there are thousands of them….


    So instead of redirecting all the links, can the htaccess be rewritten to say the following?


    -zip.html rewrite or redirect to .zip.html


    AND


    -pdf.html rewrite or redirect to .pdf.html


    Thanks for your time in advance.





    #2
    Re: Adding rule to htaccess file to rewrite or redirect filename

    This should work:

    RewriteCond %{REQUEST_URI} ^/product/(.*)-zip\.html$
    RewriteRule ^(.*)$ http://www.domain.com/%1.zip.html [R=301,L]
    David Hubbard
    CIO
    Miva
    [email protected]
    http://www.miva.com

    Comment

    Working...
    X