how .htaccess rewrite of domain.com/exit.php?=http://otherdomain.com/somelocation.php

Discussion in 'Apache' started by veedee, Aug 17, 2008.

  1. #1
    I have a wordpress blog located in http://www.mydomain.com/, some of my posts link to other domain and I already have a 301 redirection page, thus when I link to other domain's post, the link format is: "http://www.mydomain.com/exit.php?uri=http://www.otherdomain.com/somepost.php", http://www.mydomain.com/exit.php?uri=http://www.yourdomain.com/anotherpost.php etc..etc, 'exit.php' is a 301 redirection page.

    What I want is to make a 'nice' link format such as http://www.mydomain.com/exit/http://www.otherdomain.com/somepost.php (without ugly ? and = ) with a .htaccess file (but I have already had .htaccess which was made by wordpress blog when I first installed it), could someone shed me some light on it?

    Thanks
     
    veedee, Aug 17, 2008 IP
  2. jayshah

    jayshah Peon

    Messages:
    1,126
    Likes Received:
    68
    Best Answers:
    1
    Trophy Points:
    0
    #2
    You'd need a rule like:

    RewriteRule exit/(.*) exit.php?uri=$1 [L]
    Code (markup):
    Put that into the .htaccess in your public_html folder
    Jay
     
    jayshah, Aug 17, 2008 IP