SEO Specialist

Canonical Hostnames and URL on Apache-Based Servers

Posted on: March 12, 2009

Create a file by any text editor and save it as “.htaccess.txt”
Next, copy and paste the below information into the file and save.
RewriteEngine On
rewritecond %{http_host} ^vonfelten.com
rewriteRule ^(.*) http://www.vonfelten.com/$1 [R=301,L]

In this sample (which is shown on apache.org) we will change /~user by the canonical /u/user and fix a missing trailing slash for /u/user

RewriteRule ^/~([^/]+)/?(.*) /u/$1/$2 [R]
RewriteRule ^/([uge])/([^/]+)$ /$1/$2/ [R]

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

inba Seo Analyst

Archives

March 2009
M T W T F S S
« Feb   Apr »
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

Blog Stats

  • 14,154 hits

RSS Seo Analyst

free counters
%d bloggers like this: