Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

php.net "Shortcut URLs for the Manual"

0 views
Skip to first unread message

Matt

unread,
Mar 18, 2001, 6:42:07 PM3/18/01
to
I apologize if this has been asked before, but I am intrigued by the
shortcut URL that php.net employs for users who know the exact name of the
function for which they need help. Is there anyone (perhaps many) who knows
how this is done? I'm not interested so much in code, although that would
be welcome, but rather a brief explanation showing how I can take the
following address: www.theforcer.com/blah, and have it resolved as
www.theforcer.com/article.php?a=blah. It would also be a lovely plus to
know how to have the address www.theforcer.com/blah appear in the address
bar instead of www.theforcer.com/article.php?a=blah.

Thank you,
Matthew Boulos


CC Zona

unread,
Mar 18, 2001, 7:02:09 PM3/18/01
to
In article <jJbt6.64811$x27.4...@news1.rdc2.on.home.com>,

I know you're looking for a PHP solution for this, and it is possible to do
it that way too, but I suspect php.net is just using mod_rewrite. It's a
powerful Apache module that allows you to use regular expression pattern
matching, environment variables, etc. as a basis for "rewriting" urls,
either visibly or transparently. It can do nifty things like "If a file
exists at 'www.theforcer.com/blah', then display that resource, otherwise
rewrite the url invisibly to 'www.theforcer.com/article.php?a=blah' unless
the HTTP_REFERER is from 'www.thehtmlthief.com' in which case rewrite the
url visibly to 'www.theforcer.com/404error.html'. Great stuff. The docs
are at apache.org.

The PHP solution involves using the variables found in phpinfo() to parse
the current url into variables, rewrite them into a new url, then send a
new header(). But mod_rewrite is so much more elegant. And I expect a
good deal faster for the task.

--
CC

Matt

unread,
Mar 19, 2001, 12:00:07 AM3/19/01
to
Thank you very much, that was very clear and insightful.
- Matthew Boulos

"CC Zona" <ccz...@nospam.invalid> wrote in message
news:50ct6.8169$227.8...@newsread2.prod.itd.earthlink.net...

0 new messages