mirror of https://github.com/phanan/htaccess.git
Merge pull request #33 from djc/patch-1
Show off FallbackResource in Alias Paths To Script section
This commit is contained in:
commit
6f28b68f47
|
@ -121,6 +121,11 @@ RewriteRule ^source-directory/(.*) target-directory/$1
|
||||||
```
|
```
|
||||||
|
|
||||||
### Alias Paths To Script
|
### Alias Paths To Script
|
||||||
|
``` apacheconf
|
||||||
|
FallbackResource /index.fcgi
|
||||||
|
```
|
||||||
|
This example has an `index.fcgi` file in some directory, and any requests within that directory that fail to resolve a filename/directory will be sent to the `index.fcgi` script. It's good if you want `baz.foo/some/cool/path` to be handled by `baz.foo/index.fcgi` (which also supports requests to `baz.foo`) while maintaining `baz.foo/css/style.css` and the like. Get access to the original path from the PATH_INFO environment variable, as exposed to your scripting environment.
|
||||||
|
|
||||||
``` apacheconf
|
``` apacheconf
|
||||||
RewriteEngine On
|
RewriteEngine On
|
||||||
RewriteRule ^$ index.fcgi/ [QSA,L]
|
RewriteRule ^$ index.fcgi/ [QSA,L]
|
||||||
|
@ -128,7 +133,7 @@ RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
RewriteCond %{REQUEST_FILENAME} !-d
|
RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
RewriteRule ^(.*)$ index.fcgi/$1 [QSA,L]
|
RewriteRule ^(.*)$ index.fcgi/$1 [QSA,L]
|
||||||
```
|
```
|
||||||
This example has an `index.fcgi` file in some directory, and any requests within that directory that fail to resolve a filename/directory will be sent to the `index.fcgi` script. It's good if you want `baz.foo/some/cool/path` to be handled by `baz.foo/index.fcgi` (which also supports requests to `baz.foo`) while maintaining `baz.foo/css/style.css` and the like.
|
This is a less efficient version of the FallbackResource directive (because using `mod_rewrite` is more complex than just handling the `FallbackResource` directive), but it's also more flexible.
|
||||||
|
|
||||||
### Redirect an Entire Site
|
### Redirect an Entire Site
|
||||||
``` apacheconf
|
``` apacheconf
|
||||||
|
|
Loading…
Reference in New Issue