mod_rewrite and incorrect $_SERVER['REQUEST_URI']

I've made my site search engine friendly using URLs like

/genere/date/id/

which in mode_rewrite will be
file.php?genre=var&date=var&id=var



but...I was assuming when I echo $_SERVER['REQUEST_URI'] it will be

      /genere/date/id/

but instead it is

     file.php?genre=var&date=var&id=var


I was wondering if anyone has had to deal with this before, if its a config problem or is there a hack to allow me to echo the correct URI for use in links etc...
Thanks!




Regards,
Nick
LVL 18
CrYpTiC_MauleRAsked:
Who is Participating?
 
LunchyConnect With a Mentor Commented:
Closed, 200 points refunded.
Lunchy
Friendly Neighbourhood Community Support Admin
0
 
Marcus BointonCommented:
Not that I'm aware of. The rewriting happens before PHP gets its hands on the request, so it doesn't know what was originally requested. You will have the recreate links based on the fact that you know what they are supposed to be.
0
 
CrYpTiC_MauleRAuthor Commented:
Thats what I thought...

      RewriteRule ^support/([0-9]*)/$ /support.php?var=$1

ok seeing something like that...would it not be possible to do something like this?

      RewriteRule ^(support/([0-9]*))/$ /support.php?REQUEST_URI=$1&var=$2

so then the request will be sent as a variable so $_GET['REQUEST_URI'] will have the original request?

This is all assumption right now havent tested it.
0
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

 
CrYpTiC_MauleRAuthor Commented:
ok just tested, works great!!! =oD
0
 
CrYpTiC_MauleRAuthor Commented:
if anyone is interested...

     RewriteRule ^support/([0-9]*)/$ /support.php?REQUEST_URI=%{REQUEST_URI}&var=$1

much better =oP, totoally forgot about the preset variables I could use.
0
 
CrYpTiC_MauleRAuthor Commented:
ack someone needs to close this O.O
0
 
CrYpTiC_MauleRAuthor Commented:
updated status? You mean status of the problem in question? Because the 4th post in this entry shows the solution...


>> if anyone is interested...
>>
>>     RewriteRule ^support/([0-9]*)/$ /support.php?REQUEST_URI=%{REQUEST_URI}&var=$1
>>
>> much better =oP, totoally forgot about the preset variables I could use.
0
All Courses

From novice to tech pro — start learning today.