You are here: Re: clean urls « PHP Programming Language « IT news, forums, messages
Re: clean urls

Posted by Malcolm Dew-Jones on 07/01/05 21:10

somaboy mx (nosuch@fakemail.fk) wrote:
: I'm looking for a way to come up with clean urls like
: http://www.mysite.com/products/233 instead of
: http://www.mysite.com/products.php?pid=233 without having to rely on
: mod_rewrite or other server-specific solutions.

: any suggestions, links to articles etc?

If this is apache then it works, you don't need to do anything, except get
the "products" to be known as a script.

The "unused" parts of the path will then be given to you by the
environment variable PATH_INFO

If you use the name "products.php" then it should work as-is.

http://www.mysite.com/products.php/more/stuff/goes/here

(PATH_INFO will contain "/more/stuff/goes/here")

If you really want to use "products" then you need to set something up so
force apache to recognize the script as being a php script. Normally
apache is configured to look for the ending ".php", but you can flag a
specific files for special handling, or an entire directory, by putting
the right rule in the conf file, or in the .htaccess file, though I
haven't done that for this task so I can't show you an example.


--

This space not for rent.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация