Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tlug] [OT] Creating user-friendly URLS with mod_rewrite/Apache



Dave M G writes:

 > So what I really want is for Apache and PHP to play nice together so 
 > that it will take pretty much anything after the ".com", in the above 
 > example where it says "kevin_cooney", and pass that to index.php to be 
 > used for looking up data in the database and passing the right information.

There should be some way to give the configuration of "./japanese as
an ordinary directory precedence", and then set *everything else* to
MIME type application/x-httpd-php.  Or you may need to set PHP as the
handler for that entire class of URLs.  (There's a separate set of
directives concerning handlers in apache.  They are used in making
mod_python-based scripts work.)

BTW, mod_rewrite is not only complex, it's the wrong tool for the job.
mod_rewrite is intended to map URLs to URLs, not URLs to content.  You
want the latter, which is what PHP is good at.  "Run away!  Run away!"

Regarding the "./japanese" subdirectory, if that is *linguistically*
Japanese rather than *comedically* Japanese, you may want to look into
content negotiation, which most browsers will do automatically.



Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links