Wednesday, October 23, 2013

setup domain redirection on .htaccess apache2

I- enable mod rewrite
# cat /etc/apache2/mods-enabled/rewrite.load
LoadModule rewrite_module /usr/lib/apache2/modules/

II- enabled directory of the website to use use rewrite mode
# cat /etc/apache2/conf-enabled/makma.conf
<Directory /var/www/dr/>
AllowOverride All

III- create .htaccess in /var/www/dr and set rule to redirect,
I set all request to redirect to

root@localhost:/var/www/dr# cat .htaccess
RewriteEngine on
RewriteCond %{HTTP_HOST} ^
RewriteRule ^(.*)$$1 [R=permanent,L]

No comments:

Post a Comment