Recipe 5.3 Creating a New URL for Existing Content
Problem
You have an existing directory which
you want to access using a different name.
Solution
Use
an Alias directive in
httpd.conf:
Alias /newurl /www/htdocs/oldurl
Discussion
While Alias is usually used to map URLs to a
directory outside of the DocumentRoot directory
tree, this is not necessarily required. There are many times when it
is desirable to have the same content accessible
via a number of different names. This is
typically the case when a directory has its name changed, and you
wish to have the old URLs continue to work, or when different people
refer to the same content is by different names.
Remember that Alias only affects the mapping of a
local URI (the /foo/bar.txt part
of http://example.com/foo/bar.txt); it
doesn't affect or change the hostname part of the
URL (the http://example.com/
part). To alter that portion of the URL, use the
Redirect or RewriteRule
directives.
See Also
|