Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Removing Search Engine's Cached osCsid's with contrib


mreigle

Recommended Posts

I'm trying to install "Spider Sessions Remover v1.0" and can't find a support thread. This contribution uses Apache mod_rewite to look for specific spiders, and remove the session (osCsid) from the URL, and return a '301' back to the spider.

 

Basically, if the spider tries to do this:

 

GET /www.example.com/product_info.php?products_id=24&osCsid=ac8d8926059625ecb8dd9115f91d5f8a

 

the Apache mod_rewrite will rewrite the url to be:

 

GET /www.example.com/product_info.php?products_id=24

 

and also return a "301" (Moved Permanently) to the spider.

 

The contribution is just a replacement .htaccess file that goes in public_html. Here's the file:

 

# $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>

 

The problem is, when I replace the contents of that file with my current .htaccess file I get the following 403, 404 error when accessing my site:

 

--------------------

Forbidden

You don't have permission to access /index.php on this server.

 

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

-------------------

 

When I change

 

"Options FollowSymLinks"

 

TO

 

"+Options FollowSymLinks"

 

I can access my index.php, but whenever I enter categories, I get a 404 error. Everything works fine with my original .htaccess

 

Little help please? Are there any error logs I could check somewhere or something? I don't know what version of Apache my web host is running because their version is customized not to tell you.

Link to comment
Share on other sites

I found THIS in my current .htaccess:

 

Options +FollowSymLinks
RewriteEngine On 
RewriteBase /

RewriteRule ^(.*)-p-(.*).html$ product_info.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-c-(.*).html$ index.php?cPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-m-(.*).html$ index.php?manufacturers_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pi-(.*).html$ popup_image.php?pID=$2&%{QUERY_STRING}
RewriteRule ^(.*)-t-(.*).html$ articles.php?tPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-a-(.*).html$ article_info.php?articles_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pr-(.*).html$ product_reviews.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pri-(.*).html$ product_reviews_info.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-i-(.*).html$ information.php?info_id=$2&%{QUERY_STRING}

 

I _THINK_ this has something to do with a "Search Engine Friendly" URLS contribution that I may have installed a long time ago but don't have it anymore due to "ultimate SEO urls" by chemo.

 

Does anyone think the edits in catalog could be getting screwed up when this stuff are gone? I'll try it with these line in .htaccess as well as the new stuff for the cached URL contribution and see if i still get thrown an error.

 

I have NO idea what contribution the above is from but I'm weeding through the contributions one by one...

Link to comment
Share on other sites

Yep, that's what's doing it. The website just doesn't work without that last stuff in .htaccess, so there must be something that requires it.

 

ughhhh, now to search through all the contributions and try to find what's causing it so I can undo it. Eh, atleast there's only thousands of them and not millions.. heh

 

If anyone could give me a hint i'd be really grateful.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...