Re: Re: Can the URL be controlled for more user-friendly readability? [SOLVED]
| From: | Curt Zirzow | Date: | Mon, 26 Dec 2005 23:31:10 +0000 |
| Subject: | Re: Re: Can the URL be controlled for more user-friendly readability? [SOLVED] | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-227879@lists.php.net to get a copy of this message | ||
On Mon, Dec 26, 2005 at 09:26:38PM +0900, Dave M G wrote:
>
> Thank you for the suggestions. Altering the rules of the Apache server
> seems to suggest the potential to have the effect I am after. I know
> nothing about configuring Apache, but I will try to learn.
> If my discovery process brings me back to PHP issues, then I will
> return here with more questions.
> I appreciate you taking the time to offer advice.
Another method that wasn't mentioned, which helps take the logic
needed to parse parameters in the more 'user-friendly' way is to
set up apache to treat a file as a directory so you could have:
http://domain.com/user/first.last.html
The 'user' is actually a file that is a php script that reads data
from $_SERVER['PATH_INFO'] and parses it as needed.
You just need to setup apache using:
<Files user>
SetHandler application/x-httpd-php
</Files>
and make a php script called user like:
<?php
var_dump($_SERVER['PATH_INFO'])'
?>
I prefer this method cause it removes any sort of programming logic
from apache, so if I decide, that well, i want to allow just
lastname.html, i only have one place to worry about the logic.
Curt.
--
cat .signature: No such file or directory