Linux ip-172-26-2-223 5.4.0-1018-aws #18-Ubuntu SMP Wed Jun 24 01:15:00 UTC 2020 x86_64
Apache
: 172.26.2.223 | : 3.148.162.188
Cant Read [ /etc/named.conf ]
8.1.13
www
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
BLACK DEFEND!
README
+ Create Folder
+ Create File
/
www /
server /
apache /
manual /
[ HOME SHELL ]
Name
Size
Permission
Action
developer
[ DIR ]
drwxr-xr-x
faq
[ DIR ]
drwxr-xr-x
howto
[ DIR ]
drwxr-xr-x
images
[ DIR ]
drwxr-xr-x
misc
[ DIR ]
drwxr-xr-x
mod
[ DIR ]
drwxr-xr-x
platform
[ DIR ]
drwxr-xr-x
programs
[ DIR ]
drwxr-xr-x
rewrite
[ DIR ]
drwxr-xr-x
ssl
[ DIR ]
drwxr-xr-x
style
[ DIR ]
drwxr-xr-x
vhosts
[ DIR ]
drwxr-xr-x
BUILDING
102
B
-rw-r--r--
LICENSE
11.09
KB
-rw-r--r--
bind.html
538
B
-rw-r--r--
bind.html.de
15.28
KB
-rw-r--r--
bind.html.en
15.19
KB
-rw-r--r--
bind.html.fr.utf8
16.49
KB
-rw-r--r--
bind.html.ja.utf8
14.34
KB
-rw-r--r--
bind.html.ko.euc-kr
10.95
KB
-rw-r--r--
bind.html.tr.utf8
16.21
KB
-rw-r--r--
caching.html
292
B
-rw-r--r--
caching.html.en
50.66
KB
-rw-r--r--
caching.html.fr.utf8
56.43
KB
-rw-r--r--
caching.html.tr.utf8
54.69
KB
-rw-r--r--
configuring.html
580
B
-rw-r--r--
configuring.html.de
16.71
KB
-rw-r--r--
configuring.html.en
17.36
KB
-rw-r--r--
configuring.html.fr.utf8
18.84
KB
-rw-r--r--
configuring.html.ja.utf8
16.98
KB
-rw-r--r--
configuring.html.ko.euc-kr
13.71
KB
-rw-r--r--
configuring.html.tr.utf8
18.57
KB
-rw-r--r--
content-negotiation.html
529
B
-rw-r--r--
content-negotiation.html.en
33.75
KB
-rw-r--r--
content-negotiation.html.fr.ut...
38.73
KB
-rw-r--r--
content-negotiation.html.ja.ut...
40.97
KB
-rw-r--r--
content-negotiation.html.ko.eu...
28.48
KB
-rw-r--r--
content-negotiation.html.tr.ut...
37.08
KB
-rw-r--r--
convenience.map
36.73
KB
-rw-r--r--
custom-error.html
586
B
-rw-r--r--
custom-error.html.en
13.58
KB
-rw-r--r--
custom-error.html.es
13.3
KB
-rw-r--r--
custom-error.html.fr.utf8
14.51
KB
-rw-r--r--
custom-error.html.ja.utf8
13.21
KB
-rw-r--r--
custom-error.html.ko.euc-kr
11.52
KB
-rw-r--r--
custom-error.html.tr.utf8
14.17
KB
-rw-r--r--
dns-caveats.html
489
B
-rw-r--r--
dns-caveats.html.en
12.37
KB
-rw-r--r--
dns-caveats.html.fr.utf8
13.39
KB
-rw-r--r--
dns-caveats.html.ja.utf8
17.37
KB
-rw-r--r--
dns-caveats.html.ko.euc-kr
13.47
KB
-rw-r--r--
dns-caveats.html.tr.utf8
12.79
KB
-rw-r--r--
dso.html
449
B
-rw-r--r--
dso.html.en
19.27
KB
-rw-r--r--
dso.html.fr.utf8
22.21
KB
-rw-r--r--
dso.html.ja.utf8
23.28
KB
-rw-r--r--
dso.html.ko.euc-kr
16.59
KB
-rw-r--r--
dso.html.tr.utf8
21.48
KB
-rw-r--r--
env.html
449
B
-rw-r--r--
env.html.en
30.62
KB
-rw-r--r--
env.html.fr.utf8
33.06
KB
-rw-r--r--
env.html.ja.utf8
30.56
KB
-rw-r--r--
env.html.ko.euc-kr
22.14
KB
-rw-r--r--
env.html.tr.utf8
32.71
KB
-rw-r--r--
expr.html
199
B
-rw-r--r--
expr.html.en
36.03
KB
-rw-r--r--
expr.html.fr.utf8
38.48
KB
-rw-r--r--
filter.html
550
B
-rw-r--r--
filter.html.en
14.84
KB
-rw-r--r--
filter.html.es
17.28
KB
-rw-r--r--
filter.html.fr.utf8
16.01
KB
-rw-r--r--
filter.html.ja.utf8
9.23
KB
-rw-r--r--
filter.html.ko.euc-kr
8.37
KB
-rw-r--r--
filter.html.tr.utf8
16
KB
-rw-r--r--
getting-started.html
316
B
-rw-r--r--
getting-started.html.en
15.22
KB
-rw-r--r--
getting-started.html.fr.utf8
17.18
KB
-rw-r--r--
getting-started.html.ru.utf8
21.27
KB
-rw-r--r--
glossary.html
650
B
-rw-r--r--
glossary.html.de
34.8
KB
-rw-r--r--
glossary.html.en
30.02
KB
-rw-r--r--
glossary.html.es
31.97
KB
-rw-r--r--
glossary.html.fr.utf8
34.01
KB
-rw-r--r--
glossary.html.ja.utf8
32.03
KB
-rw-r--r--
glossary.html.ko.euc-kr
20.88
KB
-rw-r--r--
glossary.html.tr.utf8
33.11
KB
-rw-r--r--
handler.html
649
B
-rw-r--r--
handler.html.en
11.79
KB
-rw-r--r--
handler.html.es
12.72
KB
-rw-r--r--
handler.html.fr.utf8
12.6
KB
-rw-r--r--
handler.html.ja.utf8
13.36
KB
-rw-r--r--
handler.html.ko.euc-kr
11.35
KB
-rw-r--r--
handler.html.tr.utf8
12.39
KB
-rw-r--r--
handler.html.zh-cn.utf8
11.34
KB
-rw-r--r--
index.html
981
B
-rw-r--r--
index.html.da
8.85
KB
-rw-r--r--
index.html.de
9.28
KB
-rw-r--r--
index.html.en
9.11
KB
-rw-r--r--
index.html.es
9.75
KB
-rw-r--r--
index.html.fr.utf8
9.47
KB
-rw-r--r--
index.html.ja.utf8
9.55
KB
-rw-r--r--
index.html.ko.euc-kr
8.23
KB
-rw-r--r--
index.html.pt-br
9.26
KB
-rw-r--r--
index.html.ru.utf8
10.41
KB
-rw-r--r--
index.html.tr.utf8
9.34
KB
-rw-r--r--
index.html.zh-cn.utf8
8.85
KB
-rw-r--r--
install.html
643
B
-rw-r--r--
install.html.de
25.56
KB
-rw-r--r--
install.html.en
26.97
KB
-rw-r--r--
install.html.es
29.38
KB
-rw-r--r--
install.html.fr.utf8
29.42
KB
-rw-r--r--
install.html.ja.utf8
27.58
KB
-rw-r--r--
install.html.ko.euc-kr
19.83
KB
-rw-r--r--
install.html.tr.utf8
29.06
KB
-rw-r--r--
invoking.html
650
B
-rw-r--r--
invoking.html.de
13.91
KB
-rw-r--r--
invoking.html.en
12.55
KB
-rw-r--r--
invoking.html.es
13.9
KB
-rw-r--r--
invoking.html.fr.utf8
13.42
KB
-rw-r--r--
invoking.html.ja.utf8
14.04
KB
-rw-r--r--
invoking.html.ko.euc-kr
10.87
KB
-rw-r--r--
invoking.html.tr.utf8
13.39
KB
-rw-r--r--
license.html
118
B
-rw-r--r--
license.html.en
15.49
KB
-rw-r--r--
logs.html
454
B
-rw-r--r--
logs.html.en
39.03
KB
-rw-r--r--
logs.html.fr.utf8
44.23
KB
-rw-r--r--
logs.html.ja.utf8
40.13
KB
-rw-r--r--
logs.html.ko.euc-kr
29.03
KB
-rw-r--r--
logs.html.tr.utf8
42.61
KB
-rw-r--r--
mpm.html
704
B
-rw-r--r--
mpm.html.de
11.13
KB
-rw-r--r--
mpm.html.en
13.26
KB
-rw-r--r--
mpm.html.es
10.46
KB
-rw-r--r--
mpm.html.fr.utf8
14.37
KB
-rw-r--r--
mpm.html.ja.utf8
11.7
KB
-rw-r--r--
mpm.html.ko.euc-kr
9.77
KB
-rw-r--r--
mpm.html.tr.utf8
14.19
KB
-rw-r--r--
mpm.html.zh-cn.utf8
11.26
KB
-rw-r--r--
new_features_2_0.html
712
B
-rw-r--r--
new_features_2_0.html.de
17.67
KB
-rw-r--r--
new_features_2_0.html.en
15.55
KB
-rw-r--r--
new_features_2_0.html.fr.utf8
18.27
KB
-rw-r--r--
new_features_2_0.html.ja.utf8
18.56
KB
-rw-r--r--
new_features_2_0.html.ko.euc-k...
14.52
KB
-rw-r--r--
new_features_2_0.html.pt-br
17.4
KB
-rw-r--r--
new_features_2_0.html.tr.utf8
17.37
KB
-rw-r--r--
new_features_2_2.html
520
B
-rw-r--r--
new_features_2_2.html.en
18.58
KB
-rw-r--r--
new_features_2_2.html.fr.utf8
20.73
KB
-rw-r--r--
new_features_2_2.html.ko.euc-k...
9.46
KB
-rw-r--r--
new_features_2_2.html.pt-br
10.81
KB
-rw-r--r--
new_features_2_2.html.tr.utf8
20.42
KB
-rw-r--r--
new_features_2_4.html
319
B
-rw-r--r--
new_features_2_4.html.en
28.17
KB
-rw-r--r--
new_features_2_4.html.fr.utf8
31.61
KB
-rw-r--r--
new_features_2_4.html.tr.utf8
30.66
KB
-rw-r--r--
sections.html
474
B
-rw-r--r--
sections.html.en
37.51
KB
-rw-r--r--
sections.html.fr.utf8
41.64
KB
-rw-r--r--
sections.html.ja.utf8
32.81
KB
-rw-r--r--
sections.html.ko.euc-kr
25.12
KB
-rw-r--r--
sections.html.tr.utf8
41.4
KB
-rw-r--r--
server-wide.html
489
B
-rw-r--r--
server-wide.html.en
11.88
KB
-rw-r--r--
server-wide.html.fr.utf8
12.41
KB
-rw-r--r--
server-wide.html.ja.utf8
12.02
KB
-rw-r--r--
server-wide.html.ko.euc-kr
10.41
KB
-rw-r--r--
server-wide.html.tr.utf8
12.4
KB
-rw-r--r--
sitemap.html
736
B
-rw-r--r--
sitemap.html.de
26.2
KB
-rw-r--r--
sitemap.html.en
25.95
KB
-rw-r--r--
sitemap.html.es
25.86
KB
-rw-r--r--
sitemap.html.fr.utf8
27.01
KB
-rw-r--r--
sitemap.html.ja.utf8
26.42
KB
-rw-r--r--
sitemap.html.ko.euc-kr
23.11
KB
-rw-r--r--
sitemap.html.tr.utf8
26.88
KB
-rw-r--r--
sitemap.html.zh-cn.utf8
23.98
KB
-rw-r--r--
socache.html
205
B
-rw-r--r--
socache.html.en
9.54
KB
-rw-r--r--
socache.html.fr.utf8
10.23
KB
-rw-r--r--
stopping.html
650
B
-rw-r--r--
stopping.html.de
19.53
KB
-rw-r--r--
stopping.html.en
17.4
KB
-rw-r--r--
stopping.html.es
19.32
KB
-rw-r--r--
stopping.html.fr.utf8
19.67
KB
-rw-r--r--
stopping.html.ja.utf8
19.98
KB
-rw-r--r--
stopping.html.ko.euc-kr
14.67
KB
-rw-r--r--
stopping.html.tr.utf8
19.55
KB
-rw-r--r--
suexec.html
464
B
-rw-r--r--
suexec.html.en
28.56
KB
-rw-r--r--
suexec.html.fr.utf8
32.24
KB
-rw-r--r--
suexec.html.ja.utf8
33.21
KB
-rw-r--r--
suexec.html.ko.euc-kr
24.09
KB
-rw-r--r--
suexec.html.tr.utf8
31.05
KB
-rw-r--r--
upgrading.html
209
B
-rw-r--r--
upgrading.html.en
29.98
KB
-rw-r--r--
upgrading.html.fr.utf8
33.4
KB
-rw-r--r--
urlmapping.html
484
B
-rw-r--r--
urlmapping.html.en
26.02
KB
-rw-r--r--
urlmapping.html.fr.utf8
28.39
KB
-rw-r--r--
urlmapping.html.ja.utf8
25.7
KB
-rw-r--r--
urlmapping.html.ko.euc-kr
19.33
KB
-rw-r--r--
urlmapping.html.tr.utf8
27.96
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : urlmapping.html.en
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head> <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> <!-- XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX This file is generated from xml source: DO NOT EDIT XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX --> <title>Mapping URLs to Filesystem Locations - Apache HTTP Server Version 2.4</title> <link href="./style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> <link href="./style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> <link href="./style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="./style/css/prettify.css" /> <script src="./style/scripts/prettify.min.js" type="text/javascript"> </script> <link href="./images/favicon.ico" rel="shortcut icon" /></head> <body id="manual-page"><div id="page-header"> <p class="menu"><a href="./mod/">Modules</a> | <a href="./mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="./glossary.html">Glossary</a> | <a href="./sitemap.html">Sitemap</a></p> <p class="apache">Apache HTTP Server Version 2.4</p> <img alt="" src="./images/feather.png" /></div> <div class="up"><a href="./"><img title="<-" alt="<-" src="./images/left.gif" /></a></div> <div id="path"> <a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="./">Version 2.4</a></div><div id="page-content"><div id="preamble"><h1>Mapping URLs to Filesystem Locations</h1> <div class="toplang"> <p><span>Available Languages: </span><a href="./en/urlmapping.html" title="English"> en </a> | <a href="./fr/urlmapping.html" hreflang="fr" rel="alternate" title="Français"> fr </a> | <a href="./ja/urlmapping.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> | <a href="./ko/urlmapping.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> | <a href="./tr/urlmapping.html" hreflang="tr" rel="alternate" title="Türkçe"> tr </a></p> </div> <p>This document explains how the Apache HTTP Server uses the URL of a request to determine the filesystem location from which to serve a file.</p> </div> <div id="quickview"><a href="https://www.apache.org/foundation/contributing.html" class="badge"><img src="https://www.apache.org/images/SupportApache-small.png" alt="Support Apache!" /></a><ul id="toc"><li><img alt="" src="./images/down.gif" /> <a href="#related">Related Modules and Directives</a></li> <li><img alt="" src="./images/down.gif" /> <a href="#documentroot">DocumentRoot</a></li> <li><img alt="" src="./images/down.gif" /> <a href="#outside">Files Outside the DocumentRoot</a></li> <li><img alt="" src="./images/down.gif" /> <a href="#user">User Directories</a></li> <li><img alt="" src="./images/down.gif" /> <a href="#redirect">URL Redirection</a></li> <li><img alt="" src="./images/down.gif" /> <a href="#proxy">Reverse Proxy</a></li> <li><img alt="" src="./images/down.gif" /> <a href="#rewrite">Rewriting Engine</a></li> <li><img alt="" src="./images/down.gif" /> <a href="#notfound">File Not Found</a></li> <li><img alt="" src="./images/down.gif" /> <a href="#other">Other URL Mapping Modules</a></li> </ul><h3>See also</h3><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div> <div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> <div class="section"> <h2><a name="related" id="related">Related Modules and Directives</a></h2> <table class="related"><tr><th>Related Modules</th><th>Related Directives</th></tr><tr><td><ul><li><code class="module"><a href="./mod/mod_actions.html">mod_actions</a></code></li><li><code class="module"><a href="./mod/mod_alias.html">mod_alias</a></code></li><li><code class="module"><a href="./mod/mod_autoindex.html">mod_autoindex</a></code></li><li><code class="module"><a href="./mod/mod_dir.html">mod_dir</a></code></li><li><code class="module"><a href="./mod/mod_imagemap.html">mod_imagemap</a></code></li><li><code class="module"><a href="./mod/mod_negotiation.html">mod_negotiation</a></code></li><li><code class="module"><a href="./mod/mod_proxy.html">mod_proxy</a></code></li><li><code class="module"><a href="./mod/mod_rewrite.html">mod_rewrite</a></code></li><li><code class="module"><a href="./mod/mod_speling.html">mod_speling</a></code></li><li><code class="module"><a href="./mod/mod_userdir.html">mod_userdir</a></code></li><li><code class="module"><a href="./mod/mod_vhost_alias.html">mod_vhost_alias</a></code></li></ul></td><td><ul><li><code class="directive"><a href="./mod/mod_alias.html#alias">Alias</a></code></li><li><code class="directive"><a href="./mod/mod_alias.html#aliasmatch">AliasMatch</a></code></li><li><code class="directive"><a href="./mod/mod_speling.html#checkspelling">CheckSpelling</a></code></li><li><code class="directive"><a href="./mod/mod_dir.html#directoryindex">DirectoryIndex</a></code></li><li><code class="directive"><a href="./mod/core.html#documentroot">DocumentRoot</a></code></li><li><code class="directive"><a href="./mod/core.html#errordocument">ErrorDocument</a></code></li><li><code class="directive"><a href="./mod/core.html#options">Options</a></code></li><li><code class="directive"><a href="./mod/mod_proxy.html#proxypass">ProxyPass</a></code></li><li><code class="directive"><a href="./mod/mod_proxy.html#proxypassreverse">ProxyPassReverse</a></code></li><li><code class="directive"><a href="./mod/mod_proxy.html#proxypassreversecookiedomain">ProxyPassReverseCookieDomain</a></code></li><li><code class="directive"><a href="./mod/mod_proxy.html#proxypassreversecookiepath">ProxyPassReverseCookiePath</a></code></li><li><code class="directive"><a href="./mod/mod_alias.html#redirect">Redirect</a></code></li><li><code class="directive"><a href="./mod/mod_alias.html#redirectmatch">RedirectMatch</a></code></li><li><code class="directive"><a href="./mod/mod_rewrite.html#rewritecond">RewriteCond</a></code></li><li><code class="directive"><a href="./mod/mod_rewrite.html#rewriterule">RewriteRule</a></code></li><li><code class="directive"><a href="./mod/mod_alias.html#scriptalias">ScriptAlias</a></code></li><li><code class="directive"><a href="./mod/mod_alias.html#scriptaliasmatch">ScriptAliasMatch</a></code></li><li><code class="directive"><a href="./mod/mod_userdir.html#userdir">UserDir</a></code></li></ul></td></tr></table> </div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> <div class="section"> <h2><a name="documentroot" id="documentroot">DocumentRoot</a></h2> <p>In deciding what file to serve for a given request, httpd's default behavior is to take the URL-Path for the request (the part of the URL following the hostname and port) and add it to the end of the <code class="directive"><a href="./mod/core.html#documentroot">DocumentRoot</a></code> specified in your configuration files. Therefore, the files and directories underneath the <code class="directive"><a href="./mod/core.html#documentroot">DocumentRoot</a></code> make up the basic document tree which will be visible from the web.</p> <p>For example, if <code class="directive"><a href="./mod/core.html#documentroot">DocumentRoot</a></code> were set to <code>/var/www/html</code> then a request for <code>http://www.example.com/fish/guppies.html</code> would result in the file <code>/var/www/html/fish/guppies.html</code> being served to the requesting client.</p> <p>If a directory is requested (i.e. a path ending with <code>/</code>), the file served from that directory is defined by the <code class="directive"><a href="./mod/mod_dir.html#directoryindex">DirectoryIndex</a></code> directive. For example, if <code>DocumentRoot</code> were set as above, and you were to set:</p> <div class="example"><p><code>DirectoryIndex index.html index.php</code></p></div> <p>Then a request for <code>http://www.example.com/fish/</code> will cause httpd to attempt to serve the file <code>/var/www/html/fish/index.html</code>. In the event that that file does not exist, it will next attempt to serve the file <code>/var/www/html/fish/index.php</code>.</p> <p>If neither of these files existed, the next step is to attempt to provide a directory index, if <code class="module"><a href="./mod/mod_autoindex.html">mod_autoindex</a></code> is loaded and configured to permit that.</p> <p>httpd is also capable of <a href="vhosts/">Virtual Hosting</a>, where the server receives requests for more than one host. In this case, a different <code class="directive"><a href="./mod/core.html#documentroot">DocumentRoot</a></code> can be specified for each virtual host, or alternatively, the directives provided by the module <code class="module"><a href="./mod/mod_vhost_alias.html">mod_vhost_alias</a></code> can be used to dynamically determine the appropriate place from which to serve content based on the requested IP address or hostname.</p> <p>The <code class="directive"><a href="./mod/core.html#documentroot">DocumentRoot</a></code> directive is set in your main server configuration file (<code>httpd.conf</code>) and, possibly, once per additional <a href="vhosts/">Virtual Host</a> you create.</p> </div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> <div class="section"> <h2><a name="outside" id="outside">Files Outside the DocumentRoot</a></h2> <p>There are frequently circumstances where it is necessary to allow web access to parts of the filesystem that are not strictly underneath the <code class="directive"><a href="./mod/core.html#documentroot">DocumentRoot</a></code>. httpd offers several different ways to accomplish this. On Unix systems, symbolic links can bring other parts of the filesystem under the <code class="directive"><a href="./mod/core.html#documentroot">DocumentRoot</a></code>. For security reasons, httpd will follow symbolic links only if the <code class="directive"><a href="./mod/core.html#options">Options</a></code> setting for the relevant directory includes <code>FollowSymLinks</code> or <code>SymLinksIfOwnerMatch</code>.</p> <p>Alternatively, the <code class="directive"><a href="./mod/mod_alias.html#alias">Alias</a></code> directive will map any part of the filesystem into the web space. For example, with</p> <pre class="prettyprint lang-config">Alias "/docs" "/var/web"</pre> <p>the URL <code>http://www.example.com/docs/dir/file.html</code> will be served from <code>/var/web/dir/file.html</code>. The <code class="directive"><a href="./mod/mod_alias.html#scriptalias">ScriptAlias</a></code> directive works the same way, with the additional effect that all content located at the target path is treated as <a class="glossarylink" href="./glossary.html#cgi" title="see glossary">CGI</a> scripts.</p> <p>For situations where you require additional flexibility, you can use the <code class="directive"><a href="./mod/mod_alias.html#aliasmatch">AliasMatch</a></code> and <code class="directive"><a href="./mod/mod_alias.html#scriptaliasmatch">ScriptAliasMatch</a></code> directives to do powerful <a class="glossarylink" href="./glossary.html#regex" title="see glossary">regular expression</a> based matching and substitution. For example,</p> <pre class="prettyprint lang-config">ScriptAliasMatch "^/~([a-zA-Z0-9]+)/cgi-bin/(.+)" "/home/$1/cgi-bin/$2"</pre> <p>will map a request to <code>http://example.com/~user/cgi-bin/script.cgi</code> to the path <code>/home/user/cgi-bin/script.cgi</code> and will treat the resulting file as a CGI script.</p> </div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> <div class="section"> <h2><a name="user" id="user">User Directories</a></h2> <p>Traditionally on Unix systems, the home directory of a particular <em>user</em> can be referred to as <code>~user/</code>. The module <code class="module"><a href="./mod/mod_userdir.html">mod_userdir</a></code> extends this idea to the web by allowing files under each user's home directory to be accessed using URLs such as the following.</p> <div class="example"><p><code>http://www.example.com/~user/file.html</code></p></div> <p>For security reasons, it is inappropriate to give direct access to a user's home directory from the web. Therefore, the <code class="directive"><a href="./mod/mod_userdir.html#userdir">UserDir</a></code> directive specifies a directory underneath the user's home directory where web files are located. Using the default setting of <code>Userdir public_html</code>, the above URL maps to a file at a directory like <code>/home/user/public_html/file.html</code> where <code>/home/user/</code> is the user's home directory as specified in <code>/etc/passwd</code>.</p> <p>There are also several other forms of the <code>Userdir</code> directive which you can use on systems where <code>/etc/passwd</code> does not contain the location of the home directory.</p> <p>Some people find the "~" symbol (which is often encoded on the web as <code>%7e</code>) to be awkward and prefer to use an alternate string to represent user directories. This functionality is not supported by mod_userdir. However, if users' home directories are structured in a regular way, then it is possible to use the <code class="directive"><a href="./mod/mod_alias.html#aliasmatch">AliasMatch</a></code> directive to achieve the desired effect. For example, to make <code>http://www.example.com/upages/user/file.html</code> map to <code>/home/user/public_html/file.html</code>, use the following <code>AliasMatch</code> directive:</p> <pre class="prettyprint lang-config">AliasMatch "^/upages/([a-zA-Z0-9]+)(/(.*))?$" "/home/$1/public_html/$3"</pre> </div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> <div class="section"> <h2><a name="redirect" id="redirect">URL Redirection</a></h2> <p>The configuration directives discussed in the above sections tell httpd to get content from a specific place in the filesystem and return it to the client. Sometimes, it is desirable instead to inform the client that the requested content is located at a different URL, and instruct the client to make a new request with the new URL. This is called <em>redirection</em> and is implemented by the <code class="directive"><a href="./mod/mod_alias.html#redirect">Redirect</a></code> directive. For example, if the contents of the directory <code>/foo/</code> under the <code class="directive"><a href="./mod/core.html#documentroot">DocumentRoot</a></code> are moved to the new directory <code>/bar/</code>, you can instruct clients to request the content at the new location as follows:</p> <pre class="prettyprint lang-config">Redirect permanent "/foo/" "http://www.example.com/bar/"</pre> <p>This will redirect any URL-Path starting in <code>/foo/</code> to the same URL path on the <code>www.example.com</code> server with <code>/bar/</code> substituted for <code>/foo/</code>. You can redirect clients to any server, not only the origin server.</p> <p>httpd also provides a <code class="directive"><a href="./mod/mod_alias.html#redirectmatch">RedirectMatch</a></code> directive for more complicated rewriting problems. For example, to redirect requests for the site home page to a different site, but leave all other requests alone, use the following configuration:</p> <pre class="prettyprint lang-config">RedirectMatch permanent "^/$" "http://www.example.com/startpage.html"</pre> <p>Alternatively, to temporarily redirect all pages on one site to a particular page on another site, use the following:</p> <pre class="prettyprint lang-config">RedirectMatch temp ".*" "http://othersite.example.com/startpage.html"</pre> </div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> <div class="section"> <h2><a name="proxy" id="proxy">Reverse Proxy</a></h2> <p>httpd also allows you to bring remote documents into the URL space of the local server. This technique is called <em>reverse proxying</em> because the web server acts like a proxy server by fetching the documents from a remote server and returning them to the client. It is different from normal (forward) proxying because, to the client, it appears the documents originate at the reverse proxy server.</p> <p>In the following example, when clients request documents under the <code>/foo/</code> directory, the server fetches those documents from the <code>/bar/</code> directory on <code>internal.example.com</code> and returns them to the client as if they were from the local server.</p> <pre class="prettyprint lang-config">ProxyPass "/foo/" "http://internal.example.com/bar/" ProxyPassReverse "/foo/" "http://internal.example.com/bar/" ProxyPassReverseCookieDomain internal.example.com public.example.com ProxyPassReverseCookiePath "/foo/" "/bar/"</pre> <p>The <code class="directive"><a href="./mod/mod_proxy.html#proxypass">ProxyPass</a></code> configures the server to fetch the appropriate documents, while the <code class="directive"><a href="./mod/mod_proxy.html#proxypassreverse">ProxyPassReverse</a></code> directive rewrites redirects originating at <code>internal.example.com</code> so that they target the appropriate directory on the local server. Similarly, the <code class="directive"><a href="./mod/mod_proxy.html#proxypassreversecookiedomain">ProxyPassReverseCookieDomain</a></code> and <code class="directive"><a href="./mod/mod_proxy.html#proxypassreversecookiepath">ProxyPassReverseCookiePath</a></code> rewrite cookies set by the backend server.</p> <p>It is important to note, however, that links inside the documents will not be rewritten. So any absolute links on <code>internal.example.com</code> will result in the client breaking out of the proxy server and requesting directly from <code>internal.example.com</code>. You can modify these links (and other content) in a page as it is being served to the client using <code class="module"><a href="./mod/mod_substitute.html">mod_substitute</a></code>.</p> <pre class="prettyprint lang-config">Substitute "s/internal\.example\.com/www.example.com/i"</pre> <p>For more sophisticated rewriting of links in HTML and XHTML, the <code class="module"><a href="./mod/mod_proxy_html.html">mod_proxy_html</a></code> module is also available. It allows you to create maps of URLs that need to be rewritten, so that complex proxying scenarios can be handled.</p> </div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> <div class="section"> <h2><a name="rewrite" id="rewrite">Rewriting Engine</a></h2> <p>When even more powerful substitution is required, the rewriting engine provided by <code class="module"><a href="./mod/mod_rewrite.html">mod_rewrite</a></code> can be useful. The directives provided by this module can use characteristics of the request such as browser type or source IP address in deciding from where to serve content. In addition, mod_rewrite can use external database files or programs to determine how to handle a request. The rewriting engine is capable of performing all three types of mappings discussed above: internal redirects (aliases), external redirects, and proxying. Many practical examples employing mod_rewrite are discussed in the <a href="rewrite/">detailed mod_rewrite documentation</a>.</p> </div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> <div class="section"> <h2><a name="notfound" id="notfound">File Not Found</a></h2> <p>Inevitably, URLs will be requested for which no matching file can be found in the filesystem. This can happen for several reasons. In some cases, it can be a result of moving documents from one location to another. In this case, it is best to use <a href="#redirect">URL redirection</a> to inform clients of the new location of the resource. In this way, you can assure that old bookmarks and links will continue to work, even though the resource is at a new location.</p> <p>Another common cause of "File Not Found" errors is accidental mistyping of URLs, either directly in the browser, or in HTML links. httpd provides the module <code class="module"><a href="./mod/mod_speling.html">mod_speling</a></code> (sic) to help with this problem. When this module is activated, it will intercept "File Not Found" errors and look for a resource with a similar filename. If one such file is found, mod_speling will send an HTTP redirect to the client informing it of the correct location. If several "close" files are found, a list of available alternatives will be presented to the client.</p> <p>An especially useful feature of mod_speling, is that it will compare filenames without respect to case. This can help systems where users are unaware of the case-sensitive nature of URLs and the unix filesystem. But using mod_speling for anything more than the occasional URL correction can place additional load on the server, since each "incorrect" request is followed by a URL redirection and a new request from the client.</p> <p><code class="module"><a href="./mod/mod_dir.html">mod_dir</a></code> provides <code class="directive"><a href="./mod/mod_dir.html#fallbackresource">FallbackResource</a></code>, which can be used to map virtual URIs to a real resource, which then serves them. This is a very useful replacement for <code class="module"><a href="./mod/mod_rewrite.html">mod_rewrite</a></code> when implementing a 'front controller'</p> <p>If all attempts to locate the content fail, httpd returns an error page with HTTP status code 404 (file not found). The appearance of this page is controlled with the <code class="directive"><a href="./mod/core.html#errordocument">ErrorDocument</a></code> directive and can be customized in a flexible manner as discussed in the <a href="custom-error.html">Custom error responses</a> document.</p> </div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> <div class="section"> <h2><a name="other" id="other">Other URL Mapping Modules</a></h2> <p>Other modules available for URL mapping include:</p> <ul> <li><code class="module"><a href="./mod/mod_actions.html">mod_actions</a></code> - Maps a request to a CGI script based on the request method, or resource MIME type.</li> <li><code class="module"><a href="./mod/mod_dir.html">mod_dir</a></code> - Provides basic mapping of a trailing slash into an index file such as <code>index.html</code>.</li> <li><code class="module"><a href="./mod/mod_imagemap.html">mod_imagemap</a></code> - Maps a request to a URL based on where a user clicks on an image embedded in a HTML document.</li> <li><code class="module"><a href="./mod/mod_negotiation.html">mod_negotiation</a></code> - Selects an appropriate document based on client preferences such as language or content compression.</li> </ul> </div></div> <div class="bottomlang"> <p><span>Available Languages: </span><a href="./en/urlmapping.html" title="English"> en </a> | <a href="./fr/urlmapping.html" hreflang="fr" rel="alternate" title="Français"> fr </a> | <a href="./ja/urlmapping.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> | <a href="./ko/urlmapping.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> | <a href="./tr/urlmapping.html" hreflang="tr" rel="alternate" title="Türkçe"> tr </a></p> </div><div class="top"><a href="#page-header"><img src="./images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Libera.chat, or sent to our <a href="https://httpd.apache.org/lists.html">mailing lists</a>.</div> <script type="text/javascript"><!--//--><![CDATA[//><!-- var comments_shortname = 'httpd'; var comments_identifier = 'http://httpd.apache.org/docs/2.4/urlmapping.html'; (function(w, d) { if (w.location.hostname.toLowerCase() == "httpd.apache.org") { d.write('<div id="comments_thread"><\/div>'); var s = d.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier; (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); } else { d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>'); } })(window, document); //--><!]]></script></div><div id="footer"> <p class="apache">Copyright 2023 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> <p class="menu"><a href="./mod/">Modules</a> | <a href="./mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="./glossary.html">Glossary</a> | <a href="./sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- if (typeof(prettyPrint) !== 'undefined') { prettyPrint(); } //--><!]]></script> </body></html>
Close