I want to add a ServerAlias pointing to a url say "www.example.com/somthing/more". I know this is perfectly possible in case of "www.example.com" or "*.example.com" for eg.
Asked
Active
Viewed 60 times
1 Answers
1
TL;DR;
No.
Server[Name|Alias]
accepts hostnames only.
To go beyond hostnames, you need to look into <Location>
, Alias
, Rewrite
directives or the like.
If you had foo.example.com
and wanted to redirect to http://bar.example.com/directory
, then you could do something like this:
<VirtualHost *:80>
ServerName foo.example.com
RewriteEngine on
RewriteRule .* http://bar.example.com/directory [R=301,L]
</VirtualHost>

EEAA
- 109,363
- 18
- 175
- 245