Forum » The Geeks Corner » Website WordPress - Help » How to redirect www URLs to non-www

How to redirect www URLs to non-www

  • How to redirect www URLs to non-www?
    You can redirect all of the requests for domain to
    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 and to you websites name.

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

    This is what it looks like on my 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 that visitor will be redirected to automatically.

    Any questions as always just ask.
    Thermaltake Core V71, Water cooled, EK Velocity sTR4 Waterblock, 270 GPH Pond Pump, 5 Gallon Reservoir, Asus Prime TRX40 Pro, AMD Threadripper 3970X @STOCK-MHZ, 64 gigs Corsair DDR4-3600 26-25-25-58 CR1, EVGA RTX 2080 TI XC, Hard Drives Crucial 256gig M550, 3 Crucial SSD 2TB, 1 Western Digital 5TB 128meg cache, 2 Seagate 4TB 256meg cache, Corsair 1050 watt SINGLE RAIL, OS LINUX Xubuntu 20.04 LTS x64 and Windows 10 Pro 1909
    This post was edited by beast-usa (Admin) at December 31, 2018 12:45 AM PST
      December 30, 2018 1:30 PM PST