Re: URLs

From: Date: Thu, 12 Jul 2007 15:34:11 +0000
Subject: Re: URLs
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-258711@lists.php.net to get a copy of this message
This may or may not be a PHP question - I'll let the group decide. Note this URL: http://www.someplace.com/SomeDirectory/SomeFile compared to this URL: http://www.someplace.com/SomeDirectory/SomeFile.php Okay. How does one create the URL with no file extension? Is this done through PHP or is this a server setting? Thanks in advance!
A number of ways. You could use mod_rewrite, though you shouldn't if you care at all about performance. Directories. ie. Make SomeFile a directory with an index.php file in it. You will end up up with a trailing slash on the URL though. ForceType (IIRC). Use this directive in Apache to specify that SomeFile is actually be parsed by PHP. SomeFile should be a PHP script. Or SomeDirectory could actually be a PHP file again used with ForceType which inspects the URL and serves up the correct content. The ForceType method is used on phpguru.org to make "static" look like a directory. It's actually a PHP file that shows the correct template based on the URL. Eg: http://www.phpguru.org/static/positioning.html -- Richard Heyes +44 (0)844 801 1072 http://www.websupportsolutions.co.uk Knowledge Base and HelpDesk software

« previous php.general (#258711) next »