Onsite SEO - Chapter 3 - URL Rewriting [118]

What's an URL?

It's the abbreviation of "Uniform resource locator" that we all know by Web Address. 
The correct format of an URL it's important on the SEO as it identify and match your keywords with your Web address.

Common mistakes:
  • Url's with variables. Example: /company,php?var=1&d=a
  • Very long Url's

Webs built with PHP:

How to use .htacess to convert your URL's to a more friendly ready version:

This method is defined as 301 redirection. Below you can find some technics to convert your URL:
# move a single page
Redirect 301 /oldpage./oldpagehtml http://wwwexamplecom/newpagehtml http://www.example.com/newpage.html

# move your entire
site
Redirect 301 / http://www.example.com/

# change all
html to php
RedirectMatch 301 (.*).(*)html$ http://wwwexamplecom$1php$ http://www.example.com$1.php

# change all aspx to php
RedirectMatch 301 (.*).aspx$ http://www.example.com$1.php

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

# redirect non www to www
Options +FollowSymLinks 
RewriteEngine on 
RewriteCond %{HTTP_HOST} ^your
^yoursitecom [NC] .com [NC] 
RewriteRule ^(.*)$ http://www.your
^(*)$ http://wwwyoursitecom/$1 [LR=301].com/$1 [L,R=301]

# redirect your
redirect yoursitecom/indexphp to yoursitecom.com/index.php to yoursite.com
Options +FollowSymLinks
RewriteEngine on
# index.php to /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9} /.*index.php HTTP/
RewriteRule ^(.*)index.php$ /$1 [R=301,L]


Webs built in Windows IIS:

Use IIS Server and follow the steps to redirect your Url's.

More guides soon...