redirect folders (and all the link)

Discussion in 'Apache' started by cosy, Aug 3, 2008.

  1. #1
    i will like to change some folder but i dont like to lose all the links that i got

    is there any way to make this using .htaccess?
    some like this site.com/folder/blabla.html to be redirected to site.com/folder2/blabla.html
     
    cosy, Aug 3, 2008 IP
  2. david_t

    david_t Member

    Messages:
    74
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    45
    #2
    Yea, sure. You could use mod_rewrite. Put this in your .htaccess file
    Options +FollowSymLinks
    RewriteEngine On
    RewriteRule /folder/(\w+).html /folder2/$1.html [R=301,L]
    Code (markup):
    I haven't tried but it should work.
     
    david_t, Aug 5, 2008 IP
    graphseo likes this.