views:

188

answers:

1

Hi,

here is my .htaccess rules:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(.*)/(.*)$ index.php?var1=$1&item=$2&var2=%{REQUEST_URI} [NC,L]
RewriteRule ^(.*)$ index.php?var1=$1 [NC]

here is an url: http://localhost/test/secondvar. (with trailing dot in the end)

the problem is that the trailing dot is not coming inside the "var2" GET variable

I used a print_r($_GET) and here is the result with the above url:

Array ( [var1] => test [var2] => secondvar [uri] => /test/secondvar. )

so my question is, how do I get that trailing dot from the URL as a parameter to the var? as YOu can see, the REQUEST_URI is showing that the apache knows of the dot.
I know I can not send the paths as GET parameters and take care to read the paths in the URI from php, but I would like to know why the dot isn't coming and how to fix it, if too complicated I rather go for the direct php solution

EDIT: is not only trailing dot but trailing ? too... =[

thanks,
Joe

A: 

It might just be that php excludes trailing dots. I know that they often convert dot's in POST/GET to underscores. I would just do

explode('/',$_SERVER['REQUEST_URI'])
James Hartig