Re: [users@httpd] Mod_rewrite and default document

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9/11/06, Bob Ionescu <bobsiegen@xxxxxxxxxxxxxx> wrote:
Erik Funkenbusch wrote:
>> # 1 rewrite /?id=123 as index.php?id=123 - Does not work

It is intended *not* to match in this case - and if you are using
numerical values, why are you using the regEx .* which matches too much,
your second rule will never work, because the first one will match once
the filepath contains 1 or n chars.

Actually, I just used numbers as an example.  I'm sorry.  The value
can be anything alphanumeric.

RewriteEngine on
RewriteRule ^([0-9]+)$ /index.php?id=$1 [L]

I'm not sure how that would match the url /?id=123 either, even if it
were only numbers.  I've tried, and the above rule doesn't even match
only with numbers.  Remember, i/m not trying to match "/123" i'm
trying to match /?id=123 (or rather anything).

The problem here is that before I started using URL rewriting, then
Apache would automatically assume default.php for the default document
when using only the querystring.  The following url's:

http://mydomain/?id=abc123
http://mydomain?id=abc123

get automatically mapped to

http://mydomain/index.php?id=abc123

I can't change that those URL's exist already, so I have to be able to
handle them when they come in.  But I want to also handle:

http://mydomain/abc123 as http://mydomain/index.php?id=abc123

See my problem?  I have to match a root page request with a query
string of ?id=[anything]

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux