Sunday 20 December 2015

How to redirect domain in apache server


Add following code to your .htaccess or httpd.conf (directory directive) file:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.yourdomain.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]
If you added directives to httpd.conf, restart Apache:

# service httpd restart
#chkconfig httpd on

No comments:

Post a Comment

How to install clamAV on Centos 6

  Install EPEL repo: Before we can do proceed, you must ensure that you have the EPEL yum repository enabled. To do this, CentO...