Redirect the Website on Apache Web server – PART 3

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.

Setting up Simple Web Server on RHEL7/Centos7

Create An Alias Web Site on Apache Web Server

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.

#vim /etc/httpd/conf.d/ittroubleshooter.conf

<VirtualHost 192.168.1.10:80>
ServerAdmin     root@ittroubleshooter.in
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.

httpd_redirect_ittroubleshooter-in

Hope this post will help Linux/Unix beginners. Please share you feedback and Comments.!!!!

Read Also

Port based hosting on Apache Web server

1
Leave a Reply

avatar
1 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
1 Comment authors
rafael Recent comment authors

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  Subscribe  
newest oldest most voted
Notify of
rafael
Guest
rafael

Great post. I was checking continuously this weblog and I’m inspired!
Extremely helpful information particularly the remaining part 🙂 I take
care of such info a lot. I used to be seeking this
certain info for a long time. Thanks and best of luck.