How to redirect the website to another domain through apache conf

If you have new website and you want to redirect that website to another domain url you need to add the virtual conf in apache configuration file and reload the apache

<VirtualHost vasundhraraje.in:80>
ServerAdmin [email protected]
ServerName vasundhraraje.in
ServerAlias www.vasundhraraje.in
RewriteEngine On
RewriteCond %{HTTP_HOST} ^vasundhraraje\.in
RewriteRule ^(.*)$ http://www.vasundhararaje.in$1 [R=permanent,L]
RewriteCond %{HTTP_HOST} ^www\.vasundhraraje\.in
RewriteRule ^(.*)$ http://www.vasundhararaje.in$1 [R=permanent,L]
</VirtualHost>

Once you add this virtual in conf add reload the apache

 

 

Comments are closed.