On 04 September 2003 11:18, [EMAIL PROTECTED] wrote:

> I've been building web sites that use a database backend for
> some time
> now.
> I typically use the format.
> http://www.mysite.com/index.php?page=contact
> http://www.mysite.com/index.php?page=home
> http://www.mysite.com/index.php?page=aboutus
> etc....
> My most recent job wants to use differnt pages, so the search engines
> will pick up the url's as clearly defined, and not dynamic, as I
> normally do...
> Is there a way I can still admin the pages, and allow my client to
> add/delete pages, but use static links , without '?page=home' etc...
> I hope I've made sence...
> I've discused this with my client, and he said a friend of
> his claimed
> 'that webserver software should have a module or plugin that
> will do this'
> I've never heard of that, have I been living under a rock?

Not even a module (well, except for php!) or plugin.  If you're using Apache as your 
Web server with mod_php, anything looking like path information following the script 
name is passed to your script in $_SERVER['PATH_INFO'].  Take a look at, for example:


Note the position of support.php in that URL -- this URL is processed by running 
support.php with $_SERVER['PATH_INFO'] set to '/visitors/welcome', which the script 
decodes to decide what it actually needs to display.

There's nothing particularly special in my httpd.conf file to make this work -- the 
relevant section is simply:

    <Directory "****/lco/php/">
        AddType application/x-httpd-php .php
        Order allow,deny

As a refinement, if you don't want people to see the .php on the script name, so that 
the URL could be (say):


you can tweak this to:

    <Directory "****/lco/php/">
        AddType application/x-httpd-php .php
        DefaultType application/x-httpd-php  # or ForceType if you prefer

Then you either need a relevant AliasMatch or Rewrite so the above still gets to call 
support.php, or you simply upload all your scripts to the server with their bare name 
to match.

I believe IIS is capable of passing PATH_INFO information, too, if you set it up 
right, but as I don't use it I can't be sure (or tell you how it might work!).



Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211 

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to