Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

htaccess redirect help


Guest

Recommended Posts

bots are indexing pages like this:

http://www.mysite.com/category/Category+Na...-Item-Desc.html

 

 

the only url's they should be indexing are:

http://www.mysite.com/product/Product_Name-Item-Desc.html

 

because the two above url's point to the SAME place!

 

i have edited my htaccess to stop the top url from occuring, but it didn't stop it. can anyone suggest to me what to do?

here's my htaccess:

RewriteEngine on
RewriteBase /

#-----> single file no vars
RewriteRule ^([^/]*)\.html$ $1.php?%{QUERY_STRING} [NC]

#-----> one var
RewriteRule ^/?(product)/([^/]*)\.html$ product_info.php?products_id=$2&%{QUERY_STRING} [NC]
RewriteRule ^/?(category)/([^/]*)\.html$ index.php?cPath=$2&%{QUERY_STRING} [NC]

#-----> two vars
RewriteRule ^/?(category)/(.*)\.html$ product_info.php?cPath=$2&products_id=$4&%{QUERY_STRING} [NC]

 

the "two vars" was what i determined to be the culprit, but giving it the same rule as the basic category hasn't done anything.

 

when i head to http://www.mysite.com/category/Category+Na...-Item-Desc.html ibn my browser, i get a 404 page.

 

 

when i run a link validator, it shows this url: http://www.mysite.com/category/Category+Na...-Item-Desc.html as a 200/OK response..

 

i believe the unwanted url is from the breadcrumb, but when i view the site in a browser, the url is not there. it's only showing up for bots

Link to comment
Share on other sites

upon further investigation, the only bot that sees this as a 200/ok now is wannabrowser. however, if i uncheck "Follow redirects" it produces a 404... can anyone shed any light on that for me? why is that happening?

 

 

now, i just ran a link validator on a VALID product page.... it is still linking to the bad url.

 

but when i go to the url, i am greeted with "Product not found!"

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...