View Single Post
  #1  
Old 10-25-2005, 09:37 AM
GottaDiesel's Avatar
GottaDiesel GottaDiesel is offline
Banned
 
Join Date: Sep 2003
Location: New Jersey
Posts: 1,564
.htaccess file question

Any chance you folks might know a thing or two about these files?


I have a few search engine results in msn.com that look like this (for example):

http://www.domain.com/shipping.php?...8ekfd87325hjd87

I have some code in my .htaccess file that is suppose to tell the search engine spiders that come in from a link like that to visit a link that looks like this (and remember the one with the session id (osCsid):

www.domain.com/shipping.php

With that being said, here is the htaccess file that has code that is suppose to do that. My purpose in the post is to find out if this is good or not and what the downsides (if any are) to doing this.


# $Id: .htaccess,v 1.3 2003/06/12 10:53:20 hpdl Exp $
#
# This is used with Apache WebServers
#
# For this to work, you must include the parameter 'Options' to
# the AllowOverride configuration
#
# Example:
#
#
# AllowOverride Options
#

#
# 'All' with also work. (This configuration is in the
# apache/conf/httpd.conf file)

# The following makes adjustments to the SSL protocol for Internet
# Explorer browsers



SetEnvIf User-Agent ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0



# Fix certain PHP values
# (commented out by default to prevent errors occuring on certain
# servers)

#
# php_value session.use_trans_sid 0
# php_value register_globals 1
#

#
#
#
# Spider Fix Added below
#
#
#
# $Id: .htaccess,v 1.3 2003/06/12 10:53:20 hpdl Exp $

# Set some options
Options -Indexes
Options FollowSymLinks

RewriteEngine on
RewriteBase /
#
# Skip the next two rewriterules if NOT a spider
RewriteCond %{HTTP_USER_AGENT} !(msnbot|slurp|googlebot) [NC]
RewriteRule .* - [S=2]
#
# case: leading and trailing parameters
RewriteCond %{QUERY_STRING} ^(.+)&osCsid=[0-9a-z]+&(.+)$ [NC]
RewriteRule (.*) $1?%1&%2 [R=301,L]
#
# case: leading-only, trailing-only or no additional parameters
RewriteCond %{QUERY_STRING} ^(.+)&osCsid=[0-9a-z]+$|^osCsid=[0-9a-z]+&?(.*)$ [NC]
RewriteRule (.*) $1?%1 [R=301,L]

#
# This is used with Apache WebServers
#
# For this to work, you must include the parameter 'Options' to
# the AllowOverride configuration
#
# Example:
#
#
# AllowOverride Options
#

#
# 'All' with also work. (This configuration is in the
# apache/conf/httpd.conf file)

# The following makes adjustments to the SSL protocol for Internet
# Explorer browsers



SetEnvIf User-Agent ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0



# Fix certain PHP values
# (commented out by default to prevent errors occuring on certain
# servers)

#
# php_value session.use_trans_sid 0
# php_value register_globals 1
#
Reply With Quote