httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Slive <jos...@slive.ca>
Subject Re: [users@httpd] rewrite and +MultiViews on the root file (index.php)
Date Sun, 27 Jul 2003 14:54:57 GMT

On Sun, 27 Jul 2003, Justin French wrote:
> I've got this working fine, but now I'm hoping to take it one step
> further.  I'd like everything to run through one "fusebox" script
> (index.php) transparently.  In other words, I can get this to work:
>
> http://example.com/index/about/team >
> http://example.com/index.php?section=home&page=team,
>
> but can't get index.php to work transparently:
>
> http://example.com/about/team >
> http://example.com/index.php?section=home&page=team
>
>
> Is this possible?

One easy way to do this is to simply point
ErrorDocument 404 /index.php
and look in the REDIRECT_* variables.
But this has some negative consequences (possible extra filesystem
lookups, etc).

The main complication in this is that you probably have one requirement
you haven't mentioned: you proabably want to serve images and other static
files from the server as well.  Then the question becomes: how can you
distinguish between requests that should go to the script, and requests
that should go to the filesystem.  Once you answer that, the answer should
be easy.

As an example, the following should direct everything to the script,
except requests that have a last component ending with an extension (eg.
/path/to/file.gif).

RewriteEngine On
RewriteCond %{REQUEST_URI} !.*/[^/]*\.[^/]*$
RewriteRule (.*) /index.php/$1

If you really meant that you want EVERYTHING to go to the script, then the
asnwer is really easy:

Alias / /full/unix/path/to/index.php

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message