SEO

Redirect WWW to Non WWW with .HTACCESS

One of the easiest ways to setup a 301 permanent redirect (your server must be running Apache) from www to non www is by editing the .httaccess.

The .htaccess file is a text file that you add or edit on your site. Basically it adds to or overrides the current server settings. If your host uses Apache and your editor has trouble creating a file named .htaccess, make a plain-text file with that name and paste the example below. You may have to add this code to your current .htaccess or upload it. The .htaccess should be uploaded to the root folder of your web server.

RewriteEngine On

RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC]

RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

How to 301 redirect an old page to a new page?

redirect 301 /old-page.html http://www.yoursite.com/new-page.html