Friday, August 26, 2016

URL Redirect and Virtual Hosting

URL Redirect

<VirtualHost *:80>
    ServerAdmin root@example.com
    DocumentRoot /usr/local/apache/httpdocs/
    ServerName hrms.example.com
    ServerAlias www.hrms.example.com
RewriteEngine On
Options +FollowSymlinks
 Redirect  /  http://10.10.10.2:81/login
</VirtualHost>


-----------------------------------------------------------------------------------------------------------


<VirtualHost *:80>
DocumentRoot /usr/local/apache/htdocs/example/redirection
ServerName www.example.com
ServerAlias example.com
ServerAdmin root@example.com
DirectoryIndex ip_redirect.php
<Directory /usr/local/apache/htdocs/example/redirection>
        AllowOverride All
        Order allow,deny
        Allow from all
        Options +Includes +ExecCGI -Indexes
</Directory>
CustomLog "|/usr/sbin/rotatelogs /usr/local/apachelogs/example.com_%Y-%m-%d.log 86400" combined 
ErrorLog /usr/local/apachelogs/example_error.log_%Y-%m-%d.log
</VirtualHost>


-------------------------------------------------------------------------------------------------------------


<VirtualHost *:80>
DocumentRoot /usr/local/apache/htdocs/example_doc
ServerName www.example.com
ServerAlias example.com
ServerAdmin root@example.com
DirectoryIndex index.php
<Directory /usr/local/apache/htdocs/example_doc>
        AllowOverride All
        Order allow,deny
        Allow from all
        Options +Includes +ExecCGI -Indexes
</Directory>
CustomLog "|/usr/sbin/rotatelogs /usr/local/apachelogs/example.com.log 86400" common
ErrorLog /usr/local/apachelogs/example.com_error.log
</VirtualHost>

No comments:

Post a Comment