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.

🙂

Related Post

3 Responses

  1. ahstod says:

    Copy the /boot/config.2.6.x.x.x.el5 from centos into your kernel source directory as .config, and “make oldconfig” … and them make menuconfig and tweak from there. That brings your kernel config as close to the original centos settings as possible …

    Reply ↓
  2. gratis downloaden says:

    Hey, ok, I get it, I guess – but does this really work?

    Reply ↓
  3. namran says:

    well.. it worked for me..

    much depend on how did u want to use it..

    … this is just another note for me.

    Reply ↓

Leave a Reply

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