To Redirect the Website on Apache Web server
Redirecting the Website means whenever the name of the particular website is given it should take us on some other website.
As Previously article we have seen how to configure simple Web server and how to create an alias website on Apache Web server, refer below link.
Steps to configure Redirect the web site
1) Edit the configuration file.
To redirect a website, navigate and open the configuration file (We already created the “ittroubleshooter.conf” file on previous articles) of http i.e “/etc/httpd/conf.d/ittroubleshooter.conf” and add the following line in it at the end.
<VirtualHost 192.168.1.10:80> ServerAdmin firstname.lastname@example.org DocumentRoot /var/www/html ServerName server1.ittroubleshooter.in alias /itt /var/www/html/itt Errorlog logs/server1.ittroubleshooter.in-error_log CustomLog logs/server1.ittroubleshooter.in-access_log common Redirect /it "https://www.google.co.in/" </VirtualHost> ~~:wq
2) Restart the httpd Service.
[root@server1 ~]# systemctl restart httpd [root@server1 ~]#
3) Open the firefox web browser and type the following url.
Hope this post will help Linux/Unix beginners. Please share you feedback and Comments.!!!!