Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongoose
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
mongoose
Commits
1414e2a2
Commit
1414e2a2
authored
Jan 09, 2014
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Documented rewrites for HTTP errors
parent
5fb275e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
Options.md
docs/Options.md
+13
-7
No files found.
docs/Options.md
View file @
1414e2a2
...
...
@@ -111,7 +111,7 @@ required when mongoose needs to bind on privileged port on UNIX, e.g.
Default: not set.
### url\_rewrite
\_pattern
s
### url\_rewrites
Comma-separated list of URL rewrites in the form of
`uri_pattern=file_or_directory_path`
. When Mongoose receives the request,
it constructs the file name to show by combining
`document_root`
and the URI.
...
...
@@ -119,16 +119,22 @@ However, if the rewrite option is used and `uri_pattern` matches the
requested URI, then
`document_root`
is ignored. Insted,
`file_or_directory_path`
is used, which should be a full path name or
a path relative to the web server's current working directory. Note that
`uri_pattern`
, as all mongoose patterns, is a prefix pattern.
`uri_pattern`
, as all mongoose patterns, is a prefix pattern. If
`uri_patters`
is a number, then it is treated as HTTP error code, and
`file_or_directory_path`
should be an URI to redirect to. Mongoose will issue
`302`
temporary redirect
to the specified URI, appending two parameters:
`?code=<http_error_code&orig_uri=<original_uri>`
.
This makes it possible to serve many directories outside from
`document_root`
,
redirect all requests to scripts, and do other tricky things. For example,
to redirect all accesses to
`.doc`
files to a special script, do:
redirect all requests to scripts, and do other tricky things. Examples:
mongoose -url_rewrite_patterns **.doc$=/path/to/cgi-bin/handle_doc.cgi
# Redirect all accesses to `.doc` files to a special script
mongoose -url_rewrites **.doc$=/path/to/cgi-bin/handle_doc.cgi
Or, to imitate user home directories support, do:
# Implement user home directories support
mongoose -url_rewrites /~joe/=/home/joe/,/~bill=/home/bill/
mongoose -url_rewrite_patterns /~joe/=/home/joe/,/~bill=/home/bill/
# Redirect 404 errors to a specific error page
mongoose -url_rewrites 404=/cgi-bin/error.cgi
Default: not set.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment