Go Smart with REAR (pRay, rEad, leArn, tRy)

1/24/2017

Redirecting URL Apache on Linux

2:09 PM Posted by Vandaime 1 comment

The first thing to do is open the terminal and edit httpd.conf with Linux text editor (Vi, nano, gedit, etc. In this example, I use nano). Type this code:
nano /etc/httpd/conf/httpd.conf
[Enter]

Search NameVirtualHost *:80 words in httpd.conf file and type the codes bellow:
VirtualHost *:80 >
ServerName your.url.com
Redirect / your.url2.com
</ VirtualHost >

< VirtualHost *:80 >
ServerName your.url2.com
</ VirtualHost >

Save end Exit