Skip to content

Commit

Permalink
Alias Paths to Script
Browse files Browse the repository at this point in the history
  • Loading branch information
lorepozo committed Feb 10, 2015
1 parent eda62a9 commit 6187d6f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ What I'm doing here is mostly collecting useful snippets from all over the inter
- [Force Trailing Slash](#force-trailing-slash)
- [Redirect a Single Page](#redirect-a-single-page)
- [Alias a Single Directory](#alias-a-single-directory)
- [Alias Paths to Script](#alias-paths-to-script)
- [Redirect an Entire Site](#redirect-an-entire-site)
- [Alias Clean URLs](#alias-clean-urls)
- [Security](#security)
Expand Down Expand Up @@ -102,6 +103,16 @@ RewriteEngine On
RewriteRule ^source-directory/(.*) target-directory/$1
```

### Alias Paths To Script
``` apacheconf
RewriteEngine On
RewriteRule ^$ index.fcgi/ [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
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.

### Redirect an Entire Site
``` apacheconf
Redirect 301 / http://newsite.com/
Expand Down

0 comments on commit 6187d6f

Please sign in to comment.