.Htaccess redirect help required

Discussion in 'Blogging' started by aukint, Dec 6, 2014.

  1. aukint

    aukint Junior Member

    Joined:
    Jul 14, 2013
    Messages:
    133
    Likes Received:
    13
    Occupation:
    Software Engineer
    Location:
    BlackHatWorld
    I;m using the following code to redirect images to a php page so user can't see the actual image path, currently images are in mysite.com/var/fol/img/image.jpg path but I want to redirect them all to mysite.com/img2.php?name=image.jpg on img2.php file where I'll get the image name as variable and make another redirection to a specific URL.

    HTML:
    Options +FollowSymLinks -MultiViews 
    HTML:
    RewriteEngine On 
    HTML:
    RewriteRule ^var/fol/img/(.*)\.(jpg|jpeg|gif|png|bmp)$ img2.php?name=$1 [NC]
    
    The problem all images are not showing now, where redirection si working properly!

    Can anybody help me?
     
  2. aukint

    aukint Junior Member

    Joined:
    Jul 14, 2013
    Messages:
    133
    Likes Received:
    13
    Occupation:
    Software Engineer
    Location:
    BlackHatWorld
    Can somebody help me?
     
  3. baqir14

    baqir14 Jr. VIP Jr. VIP

    Joined:
    Dec 20, 2013
    Messages:
    391
    Likes Received:
    29
    I am also looking for the informative post.
     
  4. backbonee

    backbonee Registered Member

    Joined:
    Feb 21, 2015
    Messages:
    84
    Likes Received:
    7
    Did u tried Like that..

    Options +FollowSymLinks

    RewriteEngine On
    RewriteRule ^images/([a-zA-Z0-9]+).png$ images/$1.gif
     
  5. asap1

    asap1 BANNED BANNED

    Joined:
    Mar 25, 2013
    Messages:
    4,961
    Likes Received:
    3,191
    Bruh your about 3 months late :)