How to redirect www URLs to non-www

    • 239 posts
    December 30, 2018 1:30 PM PST
    How to redirect www URLs to non-www?
    (THE LINKS ARE NOT CONNECTED TO ANY REAL WEBSITES)
    You can redirect all of the requests for www.your-website.com domain to your-website.com
    By modifying your website's .htaccess file. You have to add the following lines in the
    beginning of the file so that the redirection is properly set up:

    You can copy & paste this test just change the www.your-website.com and your-website.com to you websites name.

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www.your-website.com [NC]
    RewriteRule ^(.*)$ http://your-website.com/$1 [L,R=301]

    This is what it looks like on my beast-usa.com website:


    You can edit the .htaccess file using the File Manager in cPanel or download and edit using a FTP like FileZilla or Ipswitch.
    If you download and edit you can use any text editor like notepad, notepad++...

    It's a good idea to keep the original file just in case so save a copy of the original.
    Download and edit and before you upload the edited version rename the original something like this htaccess-12-30-2018.

    From now on, when someone accesses your website http://www.your-website.com that visitor will be redirected to http://your-website.com automatically.

    Any questions as always just ask.
    This post was edited by beastusa at December 31, 2018 12:45 AM PST