Redirecting Old Website to New Website using .htaccess

September 15, 2018|

When you migrate your website from old domain to new one, you want to preserve the link traffic to new web address. In Apache web server we use Apache Rewrite Rules to add the redirection features. The file with this type of rules added into file name .htaccess

The apache codes to add this features are as follows:


  RewriteEngine On
  RewriteCond %{HTTP_HOST} ^$ [OR]
  RewriteCond %{HTTP_HOST} ^$
  RewriteRule (.*)$$1 [R=301,L]

If you just want to redirect the single page address, the code will be as follows:

 Redirect 301 /old-post-page.html
Categories: Uncategorized

One thought on “Redirecting Old Website to New Website using .htaccess”

Leave a Reply

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