Reformatting the URI on return to the browser
| From: | Dave M G | Date: | Thu, 14 Jun 2007 03:17:31 +0000 |
| Subject: | Reformatting the URI on return to the browser | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-256961@lists.php.net to get a copy of this message | ||
PHP,
I've implemented "friendly urls" in my PHP scripts, so that people can type in things like:
http://website.com/Cats And Dogs
... and they'll be taken to the right page.
However, when they get to the page, the url will read:
http://website.com/Cats%20And%20Dogs
Not so pretty.
I've noticed that Wikipedia will alter the URI to become more readable, by replacing the spaces with underscores, like so:
http://wikipedia.org/wiki/Cats_And_Dogs
I'd like to be able to do that with my system, but I can't quite figure out where in the process of getting a URI request and returning a page that the URI will get set.
Can anyone help me with figuring out at what point I can gain control over the URI sent back, as Wikipedia does?
Thanks for any advice.
--
Dave M G
Ubuntu Feisty 7.04
Kernel 2.6.20-15-386