.htaccess file modification please

Discussion in 'PHP' started by pukhtoogle, Aug 21, 2012.

  1. #1
    pukhtoogle, Aug 21, 2012 IP
  2. pukhtoogle

    pukhtoogle Member

    Messages:
    41
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #2
    hahah no worries dude, you have just increase 1 post :)
     
    pukhtoogle, Aug 21, 2012 IP
  3. plussy

    plussy Peon

    Messages:
    152
    Likes Received:
    5
    Best Answers:
    9
    Trophy Points:
    0
    #3
    try this

    
    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule gallery/postcard.img707.htm$ http://mywebsite.com/gallery/img707.htm [R=301,L]
    
    Code (markup):
    if the 707 is dynamic and there are other numbers in other urls where the same problem appears then you can do

    
    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule gallery/postcard.img([0-9]*).htm$ http://mywebsite.com/gallery/img$1.htm [R=301,L]
    
    Code (markup):

    hope it works
     
    plussy, Aug 21, 2012 IP
  4. pukhtoogle

    pukhtoogle Member

    Messages:
    41
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #4
    Bro this is my .htaccess file where should i put the entry?

     
    pukhtoogle, Aug 21, 2012 IP
  5. plussy

    plussy Peon

    Messages:
    152
    Likes Received:
    5
    Best Answers:
    9
    Trophy Points:
    0
    #5
    
    
    RewriteEngine On 
    
    #RewriteBase /
    RewriteRule ^sitemap.xml$ google.php
    RewriteRule ^cat-(.*)-([0-9]+)\.htm$ categories.php?cat_id=$2&%{QUERY_STRING}
    RewriteRule ^cat\.htm$ categories.php?%{QUERY_STRING}
    RewriteRule gallery/postcard.img([0-9]*).htm$ http://mywebsite.com/gallery/img$1.htm [R=301,L]
    
    #Mod_bmollet : Image name in URL
    RewriteRule ^img-(.*)-([0-9]+)\.htm$ details.php?image_id=$2&%{QUERY_STRING}
    RewriteRule ^img([0-9]+)\.search.htm$ details.php?image_id=$1&%{QUERY_STRING}
    RewriteRule ^img([0-9]+)\.lightbox.htm$ details.php?image_id=$1&%{QUERY_STRING}
    RewriteRule ^img([0-9]+)\.htm$ details.php?image_id=$1&%{QUERY_STRING}
    RewriteRule ^img([0-9]+)\.([a-zA-Z0-9]+)\.htm$ details.php?image_id=$1&mode=$2&%{QUERY_STRING}
    
    
    #Mod_bmollet : This is to make search function work ( redirect links from search results )
    RewriteRule ^search\.htm$ search.php?%{QUERY_STRING}
    RewriteRule ^search\.([0-9]+)\.htm$ search.php?page=$1&%{QUERY_STRING}
    RewriteRule ^lightbox\.htm$ lightbox.php?%{QUERY_STRING}
    RewriteRule ^lightbox\.([0-9]+)\.htm$ lightbox.php?page=$1&%{QUERY_STRING}
    
    
    Code (markup):
     
    plussy, Aug 21, 2012 IP
    pukhtoogle likes this.
  6. pukhtoogle

    pukhtoogle Member

    Messages:
    41
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #6
    pukhtoogle, Aug 21, 2012 IP
  7. pukhtoogle

    pukhtoogle Member

    Messages:
    41
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #7
    Not working dear, we should change the mywebsite.com and /gallery to something dynamic as other lines has already.
     
    pukhtoogle, Aug 21, 2012 IP
  8. pukhtoogle

    pukhtoogle Member

    Messages:
    41
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #8
    pukhtoogle, Aug 21, 2012 IP