...

View Full Version : Changing /redir/?q= --> /redir?q=



tylerh
10-31-2007, 06:53 PM
i have a folder named redir with this code inside it:


<?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.

kbluhm
10-31-2007, 08:09 PM
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:


RewriteEngine on
RewriteBase /
RewriteRule ^redir$ redir/index.php [QSA,NC]

tylerh
11-01-2007, 06:23 PM
it worked!

thanks! :thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum