Namran Hussin Linux,Webdesign Apache Tips : How to force redirect old domain to new domain

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.

:)

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

Installing java plugins for x86_64 CentOSInstalling java plugins for x86_64 CentOS

download the latest from java website : http://download.oracle.com/auth/otn-pub/java/jdk/6u27-b07/jdk-6u27-linux-x64-rpm.bin?e=1313557110&h=84d2a6dfdee93e926d179d506fafa3e3 sh jdk-6u27-linux-x64-rpm.bin ln -s /usr/java/jdk1.6.0_27/jre/lib/amd64/libnpjp2.so /usr/lib64/mozilla/plugins/libnpjp2.so test by : about:plugins Related posts: Firefox 3.6.13 and JRE plugins in CentOS 5.5 Java 1.6