HTA – CEO friendly redirects

Version: 11.1
Revision: 23 Build 13

HTA – CEO friendly redirects.

Introduction:
when I was eating at the Fish ‘n Chips shop, my head was thinking about links redirect (www and non – www). But, its not just about this redirect! It’s about your site’s CEO. In other terms, I have to create a smaller HTA file which consists these redirect without hurting other search engines. But, don’t panic, these codes were written from scratch and tested for a month!
———————

1.] Download Notepad++ (http://notepad-plus.sourceforge.net/) from the author’s website and install the application.

2.] Paste these codes and save it as: “codes.htaccess” file. After that, just delete your old HTA file (which is located in your server) and upload your new version. Then, you’ll need to rename it as: “.htaccess” (without the ‘codes’).

3.] Refresh your browser and let the changes take effect.

- Codes without WWW.
—————————-

<IfModule mod_rewrite.c>
RewriteEngine On
#Options +FollowSymLinks
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
</IfModule>

—————————-

- Codes with WWW.
—————————-

<IfModule mod_rewrite.c>
RewriteEngine On
#Options +FollowSymLinks
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [R=301,L]
</IfModule>

—————————-

Copyrighted by Lair360

Comments are closed.