Let's say I have a web server with IP address: 1.2.3.4.
I also have 2 subdomains:
sth.city.eu
inf.xyz.city.eu
I'm using apache 2 on Ubuntu Server. Here's my /etc/apache2/sites-enabled/site
file:
<VirtualHost *:80>
ServerName www.sth.city.eu
ServerAlias sth.city.eu
ServerAlias inf.xyz.city.eu
ServerAlias www.inf.xyz.city.eu
ServerAdmin webmaster@localhost
DocumentRoot /var/www/city/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/city/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
LogLevel warn
ErrorLog ${APACHE_LOG_DIR}/error_city.log
CustomLog ${APACHE_LOG_DIR}/access_city.log combined
</VirtualHost>
I would like to make something like this: if someone will go to inf.xyz.city.eu
, server should automatically redirect him to sth.city.eu
(change the url). Is that possible - how can I do this? I've searched google and found Redirect
, tried to use it like this:
Redirect http://inf.xyz.city.eu http://www.sth.city.eu
But it did not work.