Process EVERYTHING with mod_rewrite/PHP

Discuss practical ways rearrange URLs using mod_rewrite.

Process EVERYTHING with mod_rewrite/PHP

Postby Fordiman » Tue Jul 31, 2007 10:28 pm

Hey.

I'm attempting to process all non-existant files using mod_rewrite, including the site's index (domain.com/).

Unfortunately, that last one is what I'm having trouble with.

Since this is part of a whole content-management system, and since I'm passing some vitals to PHP via [E=...], I really would like to not have to special-case the site index. Particularly, my host runs PHP as a CGI, rather than an Apache mod, so it's rather imperative that the HTTP:Authorization gets to PHP, as there's no other avenue I can think of.

Here's the .htaccess:
Code: Select all
#Edit: Sussed it.  Here's the soluted .htaccess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d [OR]
RewriteCond %{REQUEST_URI} =/
RewriteRule .* /handler.php [QSA,E=ROOT:%{DOCUMENT_ROOT},E=PATH:%{REQUEST_URI},E=AUTH:%{HTTP:Authorization},L]




Any help would be much appreciated!
Fordiman
 
Posts: 1
Joined: Tue Jul 31, 2007 10:22 pm

Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 25 guests

cron