SEO Hardcore

Search Engine Optimization

  • Home
  • about
  • archives
  • sitemap
January 4th, 2008

.htaccess commands

john in duplicate content, htaccess, spidering

1. Redirect to Files or Directories

Redirect permanent /oldfile.html http://www.domain.com/filename.html or
Redirect 301 /oldfile.html http://www.domain.com/filename.html

Redirect 301 /olddirectory/oldfile.html http://www.domain.com/newdirectory/newfile.html

Redirect 301 www.olddomain.com/

Also you can program your home page to always load the www.domain.com version of the URL regardless of your actualy homepage file or a user not typing www.

1a.To redirect the non-www version use:

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain.com [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]

1b.To preventĀ  your default filename from loading use:

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

2. Change the Default Directory Page

Directory Index yourfilename.html

3. Allow/Prevent Directory Browsing

IndexIgnore */*

4. Allow SSI in .html files

AddType text/html .html AddHandler server-parsed .html AddHandler server-parsed .htm

5. Keep Unwanted Users Out

order allow,deny deny from 123.456.78.90 deny from 123.456.78 deny from .aol.com allow from all

6. Prevent Linking to Your Images

RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(www.)?domain.com/.*$ [NC] RewriteRule .(gif|jpg)$ - [F]

7. Stop the Email Collectors

RewriteCond %{HTTP_USER_AGENT} Wget [OR] RewriteCond %{HTTP_USER_AGENT} CherryPickerSE [OR] RewriteCond %{HTTP_USER_AGENT} CherryPickerElite [OR] RewriteCond %{HTTP_USER_AGENT} EmailCollector [OR] RewriteCond %{HTTP_USER_AGENT} EmailSiphon [OR] RewriteCond %{HTTP_USER_AGENT} EmailWolf [OR] RewriteCond %{HTTP_USER_AGENT} ExtractorPro RewriteRule ^.*$ X.html [L]

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]
no comment

Search

Rss

  • Main Entries RSS
  • Comments RSS

Recent Entries

  • SharePoint 2007 301 redirects
  • Preventing unwanted robots from crawling your site.
  • The top 10 ways to twist your ankle doing search.
  • .htaccess commands
  • Search in 2007
  • What can ACAP do for me?
  • ACAP Launches, Robots.txt 2.0 For Blocking Search Engines?
  • Example uses of the visitor engagement metric
  • My thoughts about Omniture and WebTrends
  • SharePoint SEO Fundamentals

Recent Comments

  • Keine Kommentare vorhanden.

Meta

  • Register
  • Log in
  • Valid XHTML
  • Valid CSS 3.0
  • WordPress

Categories

  • analytics
  • apache
  • caching
  • duplicate content
  • google
  • htaccess
  • Local Search
  • microsoft
  • MOSS
  • robots.txt
  • search fun
  • silverlight
  • spidering
  • Universal search

Archives

  • May 2008
  • January 2008
  • December 2007
  • November 2007
  • October 2007
  • September 2007
  • August 2007

Blogroll

  • Charles blog
  • Data Sage
  • Garage Sale
  • Link Princess
  • SEO Hardcore
  • SEO Tools
November 2008
S M T W T F S
« May    
 1
2345678
9101112131415
16171819202122
23242526272829
30  
© 2008 Wired by SEO Hardcore
Dezzain Studio
Nature Pictures | Bamboo Blinds