PeachParts Mercedes-Benz Forum

PeachParts Mercedes-Benz Forum (http://www.peachparts.com/shopforum/)
-   Off-Topic Discussion (http://www.peachparts.com/shopforum/off-topic-discussion/)
-   -   .htaccess file question (http://www.peachparts.com/shopforum/off-topic-discussion/135272-htaccess-file-question.html)

GottaDiesel 10-25-2005 09:37 AM

.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:
#
# <Directory "/usr/local/apache/htdocs">
# AllowOverride Options
# </Directory>
#
# '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

<IfModule mod_setenvif.c>
<IfDefine SSL>
SetEnvIf User-Agent ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
</IfDefine>
</IfModule>

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

#<IfModule mod_php4.c>
# php_value session.use_trans_sid 0
# php_value register_globals 1
#</IfModule>
#
#
#
# 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:
#
# <Directory "/usr/local/apache/htdocs">
# AllowOverride Options
# </Directory>
#
# '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

<IfModule mod_setenvif.c>
<IfDefine SSL>
SetEnvIf User-Agent ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
</IfDefine>
</IfModule>

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

#<IfModule mod_php4.c>
# php_value session.use_trans_sid 0
# php_value register_globals 1
#</IfModule>

CMuc 10-26-2005 11:13 AM

This is what my brother said:


"He needs to post the full URLs that he is seeing in the MSN
search results. I'm guessing the regexes aren't catching certain
exceptions. Also, he is only handling 3 different spiders. Also,
the user agents might not match because of case sensitivity. Anyways,
it's impossible to say what the problem is since he never posted
the actual URLs he is witnessing in the search results."


All times are GMT -4. The time now is 07:00 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0
Copyright 2024 Pelican Parts, LLC - Posts may be archived for display on the Peach Parts or Pelican Parts Website