There're various kinds of different redirect operations you can do using .htaccess


301 (Permanent Redirect)

Redirect an entire site to a different URL on a permanent basis.
For example, to redirect all your site to newdomain.com

Redirect 301 / http://newdomain.com/

 

302 (Temporary Redirect)

Redirect an entire site to a different URL, but not on a permament basis (it's useful for maintenance and for SEO purposes)
For example, to redirect all your site to newdomain.com

Redirect 302 / http://newdomain.com/

 

Redirect an old file to a new file path

This is useful if you reorganize your site, changing the URL, paths and names of files, but want to keep all of your linking in, redirecting the visitor directly to the new path.
You can have also hundreds of these redirects command in your .htaccess, so it amy be useful also if you changed your site from old, useless file names to new, SEO friendly file names; being so, you'll need to insert a command row for each file to be redirected.

Redirect /olddirectory/oldfile.php http://mydomain.com/newdirectory/newfile.php
 





















 

Found this article interesting?
Subscribe to DomainRegister´s newsletter!

You can unsubscribe at any time by simply clicking the link in the footer of our emails. For information about our privacy practices, please visit our website.

We use Mailchimp as our marketing platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp s privacy practices here.

  • redirect, .htaccess
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

 Linux Directory and File Structure

Linux Directory/Folder StructureFrom amongst the several directories found within your cPanel...

 Shared Linux Hosting Plans Technical Specifications

    Cardboard Basic Starter disk space 10 MB 1 GB 2 GB monthly traffic 20...

 Reseller Linux Hosting Plans Technical Specifications

    Starter disk space as provided by plan monthly traffic as provided by plan...

 DNS Configuration for Shared Hosting Plans

In order to use our Linux Shared Hosting Plans, you need point the domain using one of the...

 How to backup your site to a FTP server with cPanel

cPanel offers an easy and powerful way to backup your site, storing your backup set on a remote...