View Single Post
  #11 (permalink)  
Old 06-20-2005, 07:29 PM
PHPfan PHPfan is offline
WebProWorld New Member
 
Join Date: Sep 2004
Location: At my desk
Posts: 16
PHPfan RepRank 0
Default Why use mod_rewrite

Quote:
Originally Posted by eristoddle
My one tip is to learn mod rewrite.
I see lots of people talk about using mod_rewrite to make URLs better, but is there a reason why no one seems to use a script that parses the URL chunks and determines what to do?

For example, for the URL www.somedomain.com/locations/wyoming/cheyenne/ why not have a script named "locations" that looks at the URL chunks and determines what to do? That seems a lot easier and flexible than having to setup a bunch of mod_rewrites.

Use forcetype in your Apache httpd.conf (or in an .htaccess file) to force it to use PHP (or whatever you're using) for that script:
Code:
<Location /locations>
        ForceType application/x-httpd-php
</Location>
Reply With Quote