X

Apache Tips : How to force redirect old domain to new domain

Change the definition of Override in /etc/httpd/conf/httpd.conf

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   Options FileInfo AuthConfig Limit
#
    AllowOverride All

Then create the following .htaccess into the DocumentRoot.

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^mesinfotostat.dev.namran.net [NC]
RewriteRule ^ http://fotostatbaru.dev.namran.net%{REQUEST_URI} [L,R=301]

so. it got change and redirected automatically .. to new domain.
if user happened to access it via the old domain.

This is important when some session data is stored within the domain name.

:)

Namran Hussin: a soft spoken guy... with exceptional interest in computers and technology. I love to learn new thing and also love to break thing for the sake of learning.. but I do abide to the self-imposed limitation or certain thing such as social thing in life, thing can be done and thing that must be avoided at whatever cost such as drug,illegal tracking, smoke,illicit activity..etc.muahahaha let's share what we had in this short term of the life.! make it worth of the living.~
Related Post
Leave a Comment