Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Oct 2007
    Posts
    46
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Changing /redir/?q= --> /redir?q=

    i have a folder named redir with this code inside it:

    Code:
    <?php 
    $q=$_GET['q']; 
    header("Location: {$q}") 
    ?>

    the link would be site.com/redir/index.php?q=http://redirectedsite.com

    i want to change that to site.com/redir?q=http://redirectedsite.com

    thanks in advance.

  • #2
    Senior Coder kbluhm's Avatar
    Join Date
    Apr 2007
    Location
    Philadelphia, PA, USA
    Posts
    1,509
    Thanks
    3
    Thanked 258 Times in 254 Posts
    Assuming you are on a Unix-based system, create a file called .htaccess that contains the following text and place it in your root folder:
    Code:
    RewriteEngine on
    RewriteBase /
    RewriteRule ^redir$ redir/index.php [QSA,NC]

  • Users who have thanked kbluhm for this post:

    tylerh (11-01-2007)

  • #3
    New Coder
    Join Date
    Oct 2007
    Posts
    46
    Thanks
    7
    Thanked 0 Times in 0 Posts
    it worked!

    thanks!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •