For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > March 2006 > "Strange" URL









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author "Strange" URL
Mateusz [PEYN] Adamus

2006-03-20, 3:56 am

Hi

Lately I've seen some "strange" URL on the web. Something like
http://server/page.php/1,232/this_is_some_title.html
or
http://server/page,1,232,this_is_some_title.php

I know that php script can gat ids and other data from these url - but
how it is done?

It would be great if you could show me an example or direct to one.

best regards
Mateusz [PEYN] Adamus
http://adamus.home.pl
Johannes Wienke

2006-03-20, 7:55 am

Am 20.03.2006 09:25 schrieb Mateusz [PEYN] Adamus:
> Hi
>
> Lately I've seen some "strange" URL on the web. Something like
> http://server/page.php/1,232/this_is_some_title.html
> or
> http://server/page,1,232,this_is_some_title.php
>
> I know that php script can gat ids and other data from these url - but
> how it is done?


Apache -> ModRewrite
Colin McKinnon

2006-03-20, 6:56 pm

Johannes Wienke wrote:

> Am 20.03.2006 09:25 schrieb Mateusz [PEYN] Adamus:
>
> apache -> ModRewrite


Actually, depending on the config of apache it doesn't even need mod_rewrite
to parse a URL like http://server/page.php/1,232/this_is_some_title.html -
it will access http://server/page.php but with the full path in the
relevant $_SERVER variables.

C.
Mateusz [PEYN] Adamus

2006-03-21, 3:55 am

Colin McKinnon napisał(a):
> Johannes Wienke wrote:
>
> Actually, depending on the config of apache it doesn't even need mod_rewrite
> to parse a URL like http://server/page.php/1,232/this_is_some_title.html -
> it will access http://server/page.php but with the full path in the
> relevant $_SERVER variables.


Mhmm. Can you tell me how to set (and what are) these settings?

I suppose I can't do it from PHP?

best regards
Mateusz [PEYN] Adamus
http://adamus.home.pl
Johannes Wienke

2006-03-21, 7:55 am

Am 21.03.2006 08:41 schrieb Mateusz [PEYN] Adamus:
> Colin McKinnon napisał(a):
>
> Mhmm. Can you tell me how to set (and what are) these settings?


This will work on nearly every apache...
http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com