Reputation: 1700
I have a VPS. I hosted a domain ipointing to a sub directory of the www folder. The domain works fine till the home page. The moment I start going to other pages its shows my servers [orginalname]/[subdirectory name] . I think I need to add a server alias to the domain's VHOST. Can anyone tell me how to do that??
Upvotes: 0
Views: 6948
Reputation: 21
I did it using the proxy Apache option, this is it:
My VirtualHost is http://dlx/
and I want to add an "alias" like http://dlx/drupal/
In the httpd.config
file I added a proxy configuration:
<VirtualHost 127.0.0.1>
ServerName dlx
DocumentRoot "C:/deluxe/"
<LocationMatch /drupal/>
ProxyPass http://localhost/drupal/
ProxyPassReverse http://localhost/drupal/
</LocationMatch>
</VirtualHost>
Configure .htaccess on my dlx virtualhost (C:/deluxe/
):
RewriteRule ^drupal/(.*)$ http://localhost/drupal/$1 [P,L]
That's it. It works for me, I hope it also works for you.
Upvotes: 2
Reputation: 5060
Are you using Apache? Try with
<VirtualHost *:80>
DocumentRoot "/path/to/document/root"
ServerName name1
ServerAlias name2
...
Upvotes: 2