Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > $REQUEST_URI is empty with every URI

Reply
Thread Tools

$REQUEST_URI is empty with every URI

 
 
Matthias Pospiech
Guest
Posts: n/a
 
      01-05-2005
I use a mod_rewrite system.
The according index.php (where modrewrite directs to) is loaded.

But nomatter what the URL looks like $REQUEST_URI is always empty
so for example for http://www.local-matthias.de/links/123/456/
I would expect $REQUEST_URI = links/123/456/
but its empty...

any idea what to check, or which configuration (apache) might be
interesting ?

Matthias
 
Reply With Quote
 
 
 
 
Toby Inkster
Guest
Posts: n/a
 
      01-05-2005
Matthias Pospiech wrote:

> I use a mod_rewrite system.
> The according index.php (where modrewrite directs to) is loaded.

[...]
> so for example for http://www.local-matthias.de/links/123/456/
> I would expect $REQUEST_URI = links/123/456/


You seem to be doing a rewrite like this:

/links/123/456 -> /index.php

Don't do that. Do this:

/links/123/456 -> /index.php?uri=/links/123/456

Then read $_GET['uri'] in your PHP.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

 
Reply With Quote
 
 
 
 
Matthias Pospiech
Guest
Posts: n/a
 
      01-06-2005
Toby Inkster wrote:

> Matthias Pospiech wrote:
>
>> I use a mod_rewrite system.
>> The according index.php (where modrewrite directs to) is loaded.

> [...]
>> so for example for http://www.local-matthias.de/links/123/456/
>> I would expect $REQUEST_URI = links/123/456/

>
> You seem to be doing a rewrite like this:
>
> /links/123/456 -> /index.php
>
> Don't do that. Do this:
>
> /links/123/456 -> /index.php?uri=/links/123/456
>
> Then read $_GET['uri'] in your PHP.
>

Why ?
It works on other servers (like www.matthiaspospiech.de)
It worked before on my home computer, but now it doesn't

How would I have to write the mod_rewrite rule, to do that ?

Currently its
RewriteRule !\.(gif|jpg|png|css|php|pdf|zip)$ index.php

and index.php set variables, and includes inc_index.php
which is the actual index.php of the website.

Matthias
 
Reply With Quote
 
Toby Inkster
Guest
Posts: n/a
 
      01-07-2005
Matthias Pospiech wrote:

> How would I have to write the mod_rewrite rule, to do that ?
>
> Currently its
> RewriteRule !\.(gif|jpg|png|css|php|pdf|zip)$ index.php


Untested...

RewriteCond %{REQUEST_FILENAME} !\.(gif|jpg|png|css|php|pdf|zip)$
RewriteRule ^(.*)$ index.php?url=$1

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
java.net.URI.relativize(java.net.URI) not really working Stanimir Stamenkov Java 1 08-17-2005 06:24 PM
Help with error: "Invalid URI: The format of the URI could not be determined." Simon Harris ASP .Net 0 05-10-2005 04:33 PM
Re: XSLT: Relative URI "my.dtd" can not be resolved without a base URI etheriau XML 1 08-23-2004 01:54 PM
XSLT: Relative URI "my.dtd" can not be resolved without a base URI Pavel XML 2 08-03-2004 11:40 PM
Invalid URI: The format of the URI could not be determined. Joe Curry ASP .Net Web Services 0 10-08-2003 04:11 PM



Advertisments