Re: User-friendly URI's
| From: | Jonathan David Edwin Wright | Date: | Thu, 17 Jan 2002 10:55:41 +0000 |
| Subject: | Re: User-friendly URI's | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-80897@lists.php.net to get a copy of this message | ||
Atcually, I#m doing it in Win2k/WinXP. To get the settings in the .htaccess file working, you need to make sure you've given permission for that directory to override a group of settings. I belive ForceType belongs to the group FileType (someone correct me if I'm wrong! :)
Somewhere in httpd.conf, where you've set your root directory is where you need to set it:
<Directory />
#Something
#Another Think
AllowOverride FileType
#OR AllowOverride All
#Final Thing
</Directory>
Check that first, otherwise that line won't force any file to be sent via the PHP parser. Also, what errors are you getting, or what is it doing?
At 11:52 17/01/2002 +0800, you wrote:
Hi, I was implementing this solution a while back. It works on Linux/Apache/PHP 4.0.6 but during testing on my Win2000/Apache/4.0.6 it doesn't. I think my php.ini are all aligned. Any thoughts? At 09:06 AM 1/4/2002, Jonathan David Edwin Wright wrote:It's actually alot easier that you think! for the news file, just create a file called 'news' (minus ' of course! ;) in your http root, then create (or append) a .htaccess with the following lines: <Files news>// Jonathan Wright // j.d.e.wright@cs.cf.ac.uk // GCS d- s: a-- C++(+) US> P+++ L+> E> W+++ !N w !O M- V- PS+@ PE+ForceType application/x-httpd-php</Files> That tells Apache to parse news via PHP. As what you've passed (ie /2002/01/02/keyword) is not a query string, you won't find it in $_SERVER{'QUERY_STRING'}. Instead, its put into $_SERVER{'PATH_INFO'}. It's then up to you to do what you want with it! :) Works for me! :) Hope that helps! :)// Y PGP t+ !5 X R- tv(-) b(+) DI++++> D+(++) G h-- r-- z--(++)