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

4 Responses

  1. beeplet says:

    now I’ll stay tuned..

    Reply
  2. JessicaNef says:

    I just love your weblog! Very nice post! Still you can do many things to improve it.

    Reply
  3. ArianaPono says:

    hi, thanks,The article was very well written, very helpful to me

    Reply
  4. slopymem says:

    ehh.. nice )

    Reply

Leave a Reply

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