Say you have decided to change domain names, or you have one address on your site that you want to redirect to a completely different location. Using htaccess redirects you can send visitors to the new site automatically!

Htaccess is a hidden file that can be found, normally, in your web site’s public_html folder. In order to modify it you will need to SSH into your server account and modify the file using your favorite command line text editor, or you can create the file yourself and upload it to the server using FTP/SFTP or SCP.

Important Notes: You should always back up important files before you modify them. If you do not know how to backup files using SSH please see this guide.

Your web site’s htaccess file may already contain important settings that need to remain in place. If your htaccess file has existing settings you will need to add the new code to what is already there. You may need to seek assistance from your web site designer or, if you are using a content management system, contact your site’s software developers for help adding new htaccess settings. Do not delete the existing htaccess file unless it is either empty or you are absolutely sure it is ok to do so.

If you have any questions regarding what is appropriate for your web site, especially if your site was built for you and you aren’t completely familiar with your site code, feel free to contact our support team and we will be happy to help.

Simple Redirects

To move an individual page on your site:

Redirect 301 /old.html http://www.test.com/new.html

This will send any visitors who are trying to go to test.com/old.html to test.com/new.html.

Breaking down the command: Redirect tells the server it will be sending this traffic to another destination. 301 informs the visitor or search engine indexing the site that the redirect is a permanent move. If you are only redirecting traffic temporarily you will want to use 302 instead of 301.

To move an entire web site (the whole domain name):

Redirect 301 / http://www.test.com/

This is often used when changing an existing domain to a new domain name.

Simple Rewrites

Rewrites are similiar to redirects in that they point one target URL to another URL, but this is actually converted by the web server itself while handling the traffic. Think of it as using a pencil and eraser to change a name as opposed to saying “See new name on attached note.”

Important Note: If your site utilizes a SSL certificate to secure traffic for an online store, form, or other secure page you will need to make sure that you do not redirect https:// links to http:// links. Redirecting secure traffic (https) to an insecure (http) address will probably scare your customers.

Rewrite www to non-www site address

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^test.com
RewriteRule (.*) http://test.com/$1 [R=301,L]

(This will automatically send visitors who type in http://www.test.com to http://test.com)

Rewrite non-www to www site address

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^test.com [NC] RewriteRule ^(.*)$ http://www.test.com/$1 [L,R=301]

(This will automatically send visitors who type in http://test.com to http://www.test.com)

You can also read up on Meta Tags if you would like to explore redirect alternatives to using htaccess.

===

sxi.io Web’s Heroic Support is always available to assist customers with this or any other issue. If you need our assistance please contact us:
Toll Free 1.800.580.4985
International 517.322.0434
[email protected]
https://manage.sxi.io/

  • Bitcoin Prices Dip Below $900 After Trading Volume Drop
  • Install Java 8 on CentOS 7
  • South America’s Biggest Stock Exchange Joins R3 Blockchain Consortium
  • African Internet Pioneer Launches Bitcoin Mining Facility
  • Twitter Pledges Action on Crypto Scams After Account Bans
  • How to Setup Free SSL Certificate for Apache on Debian 10
  • China Needs Better Regulation for Blockchain Growth, Experts Say
  • Redhat Linux: Find Out My IP Address
  • What Is POSIX Shell?
  • Questions Linger as Daily Bitcoin Transactions Pass 100,000 Milestone
  • 8 Companies That Have Filed Crypto Patents
  • Ripple Labs Raises $28 Million in Series A Round
  • Digital Asset to Open Source Smart Contract Language
  • How To Install MS SQL Server on Ubuntu 18.04/ Ubuntu 16.04 LTS
  • JP Morgan Blockchain Spin-Off Raises $2.25 Million
  • SXI LLC Company
    SXI.IO is a global Blockchain software company, specialized in developing white label crypto exchange platforms , Wallet platforms, ICO platforms, Token Erc20 .....
    Fully Managed VPS Fully Managed VPS Fully Managed VPS

    You Might Also Enjoy NewS Post

    Best Free Web Hosting 2020

    Free Hosting 1GB $0.00 USD/mo Disk space 1GB Traffic 10GB/Month Domains 2 Plesk Cpanel Databases 10 Free 12 Month https://my.sxi.io/cart.php?a=add&pid=196

    02/05/2020 READ MORE

    Download Windows Templates for Virtualizor KVM

    Download any of client OS template to the location in Node ( /var/virtualizor/Xen or KVM according to the virtualization). http://mirror.softaculous.com/virtualizor/templates/windows-2003-x86.img.gz http://mirror.softaculous.com/virtualizor/templates/windows_2003R264.img.gz http://mirror.softaculous.com/virtualizor/templates/windows-2008r2.img.gz http://mirror.softaculous.com/virtualizor/templates/windows-2012server.img.gz http://mirror.softaculous.com/virtualizor/templates/windows-2003-x86.img.gz http://mirror.softaculous.com/virtualizor/templates/windows_2003R264.img.gz http://mirror.softaculous.com/virtualizor/templates/windows-2008r2.img.gz http://mirror.softaculous.com/virtualizor/templates/windows-2012server.img.gz http://mirror.softaculous.com/virtualizor/templates/windows-2012r2.img.gz http://mirror.softaculous.com/virtualizor/templates/windows-2016.img.gz For...

    23/04/2020 READ MORE