Re: [users@httpd] Mod_rewrite and default document

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

 



>
> 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]

There's an excellent book about regular expressions from O'Reilly. Spend a 
weekend with it, really.

RewriteEngine on
# this rule will match all url's starting with index.php,
# including /index.php?foo=bar but also /index.phpxxx
RewriteRule /index.php(.*)$ /index.php$1 [L]
# if that rule isn't matched, the follwing rule will ut anything as id=
RewriteRule ^(.*)$ /index.php?id=$1 [L]

Would that help !?

Ace





>
> ---------------------------------------------------------------------
> 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

-- 
maven n : someone who is dazzlingly skilled in any field [syn: ace,
         adept, champion, sensation, mavin, virtuoso, genius,
          hotshot, star, superstar, whiz, whizz, wizard,
          wiz]
                - WordNet (r) 2.0

Suares & Co, Open Source Solutions
mail: Gravenstraat #4, Willemstad, Curacao (NA)
phone: +599 786 23 73
fax: +31 848 707 705
web: http://www.suares.an email: ace@xxxxxxxxx

---------------------------------------------------------------------
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