Jump to content
Chemo

[Contribution] Ultimate SEO URLs - by Chemo

Recommended Posts

I don't get an error message in the rewrite-mode, but the main page always stays the same when I click on different categories. When I click on a product, it says "product not found" or something like that.
Does it work in cName mode? How many products do you have?

Share this post


Link to post
Share on other sites

Hi,

I just recently installed this mod and have everything configured... I think, but nothing seems to be working. I have it set to rewrite but I am still just getting numbers, for instance:

 

product_info.php?products_id=288

 

I need a little help on this... I think the cache thing is what's messing me up, I don't know what I'm doing with cache

Share this post


Link to post
Share on other sites

Well I don't know what I did, but I got the url to show up with the correct information, but the pages were not showing up.

 

For instance, I clicked on a product and in the url is says .../product.htm but it goes to the 404 error page.

 

How do you get your site to recognize the pages correctly?

 

Any help would be appreciated. Thanks

Share this post


Link to post
Share on other sites

If you have it set for rewrite and you are getting 404s, then chances are you have your htaccess fike wrong. Set it to cName, does it work then?

Share this post


Link to post
Share on other sites

Bobby and SEO devotees,

 

I've used this Contrib with great success however it magically stopped working. My site is www.buy-a-mattress.co.uk and my htaccess still seems fine. Obviously it's turned on. I haven't touched the code so really wonder what's up. If someone could be so kind to have a look that'd be great. Let me know which bits of code you need to get a better understanding of what's going in.

 

Joe a.k.a. T0PS3O


Johan a.k.a. T0PS3O elsewhere.

 

Contributed Barclay's ePDQ Payment Module though not originally mine. Made it work though...

Share this post


Link to post
Share on other sites

I have been searching through many pages of this thread for about 2 hours now, but i didnt found anything (neither did i found a edit button, to edit my previous post). i still have problems with the buy now (buy_now) button. it wont work on search results and if i use the manufacturer drop down. please help. thanks in advance.

regards benjamin

Share this post


Link to post
Share on other sites

I have two sites with Ultimate SEO urls installed, one was a fresh install with oscommerce demo products, the other has had SEO integrated as per install instructions. The problem occurs when adding a product to the cart from the product_info.php page, on the integrated site when add to cart is clicked the browser doesn't find the link, but the demo version works fine.

 

The html for the form in 'view source' compares as follows:

 

demo site:

<form name="cart_quantity" action="http://e-shop.org.uk/seo/microsoft-intellimouse-p-3.html?action=add_product" method="post">

 

integrated site:

<form name="cart_quantity" action="http://10.0.0.3/sitename/oil-xfe-diesel-5-p-747.html/action/add_product" method="post">

 

Some where the '?' and '=' are being replaced by '/'. Any clues anyone please?

Share this post


Link to post
Share on other sites
If you have it set for rewrite and you are getting 404s, then chances are you have your htaccess fike wrong. Set it to cName, does it work then?

 

 

I just changed it to cName and it seems to work fine. What have I done wrong with the .htaccess file? I added the code to the main htaccess file in my store folder.

Share this post


Link to post
Share on other sites
I just changed it to cName and it seems to work fine.  What have I done wrong with the .htaccess file?  I added the code to the main htaccess file in my store folder.

Post your htaccess file, that's the easiest way to figure it out. Also, make sure you are getting the htaccess file from the directory you have osC installed in. If your htaccess file is in the root directory instead of the catalog directory, make sure to tell us because it makes a difference.

Share this post


Link to post
Share on other sites
I have been searching through many pages of this thread for about 2 hours now, but i didnt found anything (neither did i found a edit button, to edit my previous post). i still have problems with the buy now (buy_now) button. it wont work on search results and if i use the manufacturer drop down. please help. thanks in advance.

regards benjamin

What version did you install? The latest version has the buy now fixes integrated.

Share this post


Link to post
Share on other sites

Do you have a CRE Loaded store? What version store do you use? What other contributions do you have installed?

Edited by NHRAFan

Share this post


Link to post
Share on other sites

HTTP Server: Apache/2.0.40 (Red Hat Linux)

PHP Version: 4.2.2 (Zend: 1.2.0)

osCommerce Version: ms2-2

 

installed contribs:

 

UltraPics - MS2 Image Addon Pack!

Link: http://www.oscommerce.com/community/contributions,1642/

Master Products - MS2

Link: http://www.oscommerce.com/community/contributions,1681/

Credit Class & Gift Voucher *working*

Link: http://www.oscommerce.com/community/contributions,282/

Ultimate SEO URLs

Link: http://www.oscommerce.com/community/contributions,2823/

Simple Template System

Link: http://www.oscommerce.com/community/contributions,1524/

Header Tags Controller

Link: http://www.oscommerce.com/community/contributions,207/

Share this post


Link to post
Share on other sites

I think I've solved my problem where the separators were being replaced by forward slashes. The following setting was true, once set to false it worked.

 

Admin Control Panel -> Configuration -> My Store -> Use Search-Engine Safe URLs (still in development) -> FALSE

Share this post


Link to post
Share on other sites
I have a minor problem with this wonderful contrib.

 

I?m using Categories Tabs withs subs.

 

I have modified muy URLs to show product_id AND cpath.

 

If i use Ultimate SEO URLs, cpath is not in url, and in my product page, my tabs menu is withouth a category.

 

I need to modified this contrib to add cpath in the URL of the product info page, i know how to modify .htaccess, but i dont know how to modify this contrib.

 

An example will be:

 

NOW:

http://site.com/my-product-p-37.html

 

WITH THE REQUIRED MODIFICATION:

http://site.com/my-product-c-1_10-p-37.html

Any Help would be apreciated.

 

Thanks in advance.

 

Chemo suggested to "extract" cpath from application top, i have tryed a lot, with the funcion

 

$cPath = tep_get_product_path($HTTP_GET_VARS['products_id']);

 

 

but i?m getting mad, the cpath is not obtained, this function is present in general.php, all seems to be correct, but nothing hapens...

 

 

I send an SOS, i need to add cpath to the seo urls for products page, like this:

 

http://site.com/my-product-c-1_10-p-37.html

 

Any help?

Share this post


Link to post
Share on other sites
HTTP Server:  Apache/2.0.40 (Red Hat Linux)

PHP Version:  4.2.2 (Zend: 1.2.0)

osCommerce Version: ms2-2

 

installed contribs:

 

UltraPics - MS2 Image Addon Pack!

  Link: http://www.oscommerce.com/community/contributions,1642/

Master Products - MS2

  Link: http://www.oscommerce.com/community/contributions,1681/

Credit Class & Gift Voucher *working*

  Link: http://www.oscommerce.com/community/contributions,282/

Ultimate SEO URLs

  Link: http://www.oscommerce.com/community/contributions,2823/

Simple Template System

  Link: http://www.oscommerce.com/community/contributions,1524/

Header Tags Controller

  Link: http://www.oscommerce.com/community/contributions,207/

None of those contributions should make a difference if you installed the SEO URLs correctly. Can we look at your site? It would help to see how the links are being formed and what errors are popping up.

Share this post


Link to post
Share on other sites
Post your htaccess file, that's the easiest way to figure it out. Also, make sure you are getting the htaccess file from the directory you have osC installed in. If your htaccess file is in the root directory instead of the catalog directory, make sure to tell us because it makes a difference.

 

I edited the htaccess file in the /catalog/ directory because that is where my store is located. Here it is:

 

 

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

RewriteEngine On 
# Change "folder" to your catalog directory name
RewriteBase /catalog/
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}

Edited by Sethman

Share this post


Link to post
Share on other sites
Chemo suggested to "extract" cpath from application top, i have tryed a lot, with the funcion

 

$cPath = tep_get_product_path($HTTP_GET_VARS['products_id']);

but i?m getting mad, the cpath is not obtained, this function is present in general.php, all seems to be correct, but nothing hapens...

 

 

I send an SOS, i need to add cpath to the seo urls for products page, like this:

 

http://site.com/my-product-c-1_10-p-37.html

 

Any help?

The cPath is set by this code in application_top.php:

// calculate category path
 if (isset($HTTP_GET_VARS['cPath'])) {
   $cPath = $HTTP_GET_VARS['cPath'];
 } elseif (isset($HTTP_GET_VARS['products_id']) && !isset($HTTP_GET_VARS['manufacturers_id'])) {
   $cPath = tep_get_product_path($HTTP_GET_VARS['products_id']);
 } else {
   $cPath = '';
 }

As you can see, under the condition of $_GET[products_id] and !$_GET[manufacturers_id] it will set the cPath variable using the same function as what you are trying to use.

 

I suspect it may be an issue with your server detecting the parameters as passed from the rewrite rule. It can be debugged easily...get with me on instant messenger and I'll walk you through it.

 

Bobby

Share this post


Link to post
Share on other sites

Chemo,

 

This contrib seems to be what every store owner is looking for. I can't wait to install it and make use of it.

Do you think it might be contradicted to the SEO SiteMap contrib I already use?

I'm new to OSC with 0 knowledge of php and I'm afraid of messing thing up.

Please advise me.

 

Thanks in advance.

Share this post


Link to post
Share on other sites

Use this sitemap => Sitemap MS2.2 and then overwrite the base class with the one provided by Chris dated 11 Mar 2005.

 

Bobby

Share this post


Link to post
Share on other sites

Chemo,

 

I have spent the greater part of the past few days reading your works on SEO and some of your documents through out this site. Including your blog. After reading everything, I decided to use this contribution of yours.

 

I thought I would not have any problems as I read, then re-read / backed up, and re backed up everything before altering any code.

 

I am so impressed with how you are able to answer so many questions, support all of us in a professional manor and yet have the time to work on a new version.

 

Today I installed the contribution and I did not think I had any problems. But as soon as I added the code you have listed in your install instructions to my domain.com/catalog/.htaccess file, my site will not show up. It will not even show up with the admin url.

 

I have cutted and pased the code in the install, and the same code I saw you posted though out this thread to a notepad just incase I was adding weird spaces or whatnot and using telnet, I did a pico to my .htacces and pasted the code.

 

So, I read all the posts and have been looking long and hard at the problem. If I remove the code you have us add to the .htaccess file, the site works with no issues. When I add the code, the site will not operate at all..

 

I am getting a 500 Server error.

 

Options +FollowSymLinks

RewriteEngine On

# Change "folder" to your catalog directory name

RewriteBase /catalog/

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}

 

Just some notes, my Admin folder has a .htaccess password protect in it, and there are a few other directories that have .htaccess password protection.

 

Today I sent a letter to my host and asked them to check this code to see if there is a problem, but the fact is, they are very advanced and even offer oscommerce. Any how, what could it be?

 

I appreciate your or anyones assistance....

Share this post


Link to post
Share on other sites
I edited the htaccess file in the /catalog/ directory because that is where my store is located.  Here it is:

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

RewriteEngine On 
# Change "folder" to your catalog directory name
RewriteBase /catalog/
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}

Only thing I can see wrong here is you are missing 1 line -

 

Options +FollowSymLinks
RewriteEngine On
# Change "folder" to your catalog directory name
RewriteBase /catalog/
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}

Add Options +FollowSymLinks

Share this post


Link to post
Share on other sites
None of those contributions should make a difference if you installed the SEO URLs correctly. Can we look at your site? It would help to see how the links are being formed and what errors are popping up.

 

No sorry. But i have some snippets and some information.

If i use the manufacturers dropdown, the link is like this /index.php?manufacturers_id=10 not like /xxx-m-10.html.

Ive found the repsective code lines (taken from product_listing.php):

case 'PRODUCT_LIST_BUY_NOW':

  $lc_align = 'center';

  //Master Products           

  if ($listing['products_master_status'] != '1' && $listing['products_master'] == '0') {

    $lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'pName')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';

  } elseif ($listing['products_master'] != '0') {

    $lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_master']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';     

  } else {

    $lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';

  }

  //Master Products EOF       

  break;

 

I dont know where the problem is, because in this snippet the function tep_href_link is called, and this is what ive modified for SEO.

The other links in the product_listing, if called with isset(manufacturers_id) are fine (the text and the image link). They come up like this /xxx-p-10.html. Only the buy_now column wont work. It does work if you just browse through the categories.

 

Imho the Master Products contrib is part of the problem, because it modifies the buy_now column. If a product is just a master product without a price, the buy_now column just takes you to the product details. But the products id is always empty on the buy_now image. It comes up like /product_info.php?products_id=. Without the products id or the "action=buy_now&sort=2a" parameter.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×