mod_rewrite passes filename without $_GET values
Posted: Mon Mar 21, 2011 6:45 pm
htaccess file
php file
Input URL:
http://my.domain.com/096848478a2d6f
Here's the curious bit:
My understanding of mod_rewrite is that the ACTUAL file requested by Apache is "dl.php?f=$1".
Which in this case should be "dl.php?f=096848478a2d6f"
This 'should' state to apache to get the file 'dl.php' with a $_GET of 'f=096848478a2d6f'
So in theory, the $_GET array SHOULD look like the following:
Array ( [f] => 096848478a2d6f )
However when i print_r($_GET) in the dl file.. it returns
Array ( [f] => dl.php )
Any suggestions towards a solution?
Code: Select all
RewriteEngine On
RewriteRule ^([^/]*)$ dl.php?f=$1 [L]Code: Select all
<?php
require_once './fileManager.php';
$fm = new FileManager();
if(isset($_GET['f'])){
$fm->getFile($_GET['f']);
}
?>http://my.domain.com/096848478a2d6f
Here's the curious bit:
My understanding of mod_rewrite is that the ACTUAL file requested by Apache is "dl.php?f=$1".
Which in this case should be "dl.php?f=096848478a2d6f"
This 'should' state to apache to get the file 'dl.php' with a $_GET of 'f=096848478a2d6f'
So in theory, the $_GET array SHOULD look like the following:
Array ( [f] => 096848478a2d6f )
However when i print_r($_GET) in the dl file.. it returns
Array ( [f] => dl.php )
Any suggestions towards a solution?