Domain Forwarding Htaccess
How to redirect all pages to another domain using htaccess.
Domain forwarding htaccess. Using redirect in an htaccess file enables you to redirect users from an old page to a new page without having to keep the old page. For the slash field enter any folder names if necessary. Click the drop down box for type and choose either a permanent 301 or temporary 302 redirect.
In order to redirect your old domain to a new domain name you should add the following rewrite rule to your htaccess file. How to redirect an old domain to a new domain. Add a htaccess file that 301 redirects all the internal pages to the new domain.
If you are not going to be using the old domain and definitely want to redirect all traffic to the new site you can replace the contents of your htaccess file or add to the top of the file. Redirect to a local site file. Use a 301 redirect htaccess to point an entire site to a different url on a permanent basis.
Redirect an old domain to a new domain with htaccess if you have decided to change your site s domain and are hosting your old site on an apache server then redirecting traffic to the new site is relatively simple. This is the most common type of redirect and is useful in most situations. Enter the address you want to redirect to in the redirects to section.
Click the next drop down box and choose the domain you want to redirect. The 1 at the end of the rewriterule is important and is what ensures that each individual page on the old site is redirected to the appropriate page on the new site. Set the nameservers of the old domain to somewhere you have cpanel hosting.