How To Set Up 301 Redirection From .htaccess?

Collapse

Unconfigured Ad Widget

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • John_Accuwebhosting
    Senior Member
    • Jun 2006
    • 120

    How To Set Up 301 Redirection From .htaccess?

    You can set many types of 301 redirection from .htaccess file. We have mentioned about olddomain to newdomain 301 redirection in this topic.

    For example, if you have a websitehttp://www.olddomain.com and wish to permanently forward users to http://www.newdomain.com when they browsehttp://www.olddomain.com on their browsers.

    Add following lines on the .htaccess file :

    RewriteEngine on
    RewriteCond %{http_host} ^olddomain.com [NC,OR]
    Rewritecond %{http_host} ^www.olddomain.com [nc]
    RewriteRule ^(.*)$ http://newdomain.com/$1 [r=301,nc]


    Accuwebhosting.com
    Last edited by admin; 07-30-2015, 04:48 AM.
Working...
X