Jump to content
spidometrs

[CONTRIBUTION] Ultimate SEO URLs v2.1 - by Chemo

Recommended Posts

I updated my Contrib to version 2.1e now. Now URLs for all products named like

 

Part1-Part2

 

are changed to

 

part1part2-p-x.html

 

(while x ist the products number ...)

 

So - where can I change this? I want the '-' also be shown in my URLs ...

 

Does anyone know? (I know I changed that already in my already version ... but maybe I'm too stupid to find the place now!? I don't know ...;))

 

Addition: I guess I edited the seo_cache.php last time:

 

function strip($convert_me) {
$strip_array = array(""","'",chr(33),chr(34),chr(35),chr(36),chr(37),chr(38),chr(39),chr(40),chr(41),chr(42),chr(43),chr(44),chr(46),chr(47),chr(58),chr(59),chr(60),chr(61),chr(62),chr(63),chr(91),chr(92),chr(93),chr(94),chr(95),chr(96),chr(123),chr(124),chr(125),chr(126) );  
$strip_array2 = array(chr(45)." ");
$convert_me = str_replace($strip_array, '', $convert_me);
$convert_me = str_replace($strip_array2, ' ', $convert_me);
$convert_me = str_replace(array(' ', '  ', '__', '--'), '-', $convert_me);
$convert_me = strtolower($convert_me);
return $convert_me;
 }

 

But

 

$strip_array2 = array(chr(45)." ");

 

doesn't do anything without a space after '-' ... so this doesn't cause the problem ...

Share this post


Link to post
Share on other sites

Didn't anybody have the same problem in the past? :( Would you please tell me how you solved that ...? :rolleyes:

Share this post


Link to post
Share on other sites

Hello,

 

I?ve just installed the contrib. I hope someone would help me.

I?m getting a 403 Forbidden error when getting into the checkout.

 

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

Forbidden

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

You may need to create an index.html page or enable the directory browsing by creating an .htaccess file containing "Options +Indexes".

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

 

Apache/1.3.34 Server at pro26.abac.com Port 443

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

 

It's installed in a shared SSL server. I've had to disable the .htaccess to make

it work again but contrib. is off.

 

Any ideas ?

 

TIA Benjamin

Share this post


Link to post
Share on other sites

I just installed it but.. nothing changed. I followed the instructions. My oscommerce install is in a /store/ directory and my admin folder is called iadmin. Thanks

 

btw i cleared my cache and still nothing

Edited by heroyol

Share this post


Link to post
Share on other sites

i cant find

$action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');

in admin/categories.php

Share this post


Link to post
Share on other sites

Can anyone help and tell me why, after loading this this contribution a problem whereby when you click on a product in my site; http://www.pcplanetsales.co.uk, the page cannot be found.

 

Yet when you click refresh in the browser - the page then loads, BUT the internet explorer top bar that should display the meta tag line, now says

 

404 Page cannot be displayed/found

 

Can anyone help

 

Thank you

 

Steve


Hope it helps...

PC Planet

Share this post


Link to post
Share on other sites

Steve,

 

Nice looking site! I clicked on your categories and I didn't see any products at all.

 

Justin

 

Can anyone help and tell me why, after loading this this contribution a problem whereby when you click on a product in my site; http://www.pcplanetsales.co.uk, the page cannot be found.

 

Yet when you click refresh in the browser - the page then loads, BUT the internet explorer top bar that should display the meta tag line, now says

 

404 Page cannot be displayed/found

 

Can anyone help

 

Thank you

 

Steve

Share this post


Link to post
Share on other sites
i cant find
$action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');

in admin/categories.php

 

Who can help me?

Share this post


Link to post
Share on other sites

Hello :D

 

I think after searching through a bunch of old posts, I have answered my own questions about this mod. It's now working perfectly on my test site, which is slated to go live soon....

 

But I have one question that is really burning at me here (sorry I know this is somewhat off topic)....

 

I've seen TONS of contriibutions from Chemo (Bobby) on Oscommerce contribs section, and literally thousands of posts from Bobby in supporting his contribs. -In ALL of those, I've not found anything that should have gotten him banned from the forums.

 

-He was such an excellent resource. Ultimate SEO URLs is just one of several great mods chemo created!

 

Does anyone know WHY he was banned from these forums?

 

.....Just curious....

 

 

By the way... Manica, regarding your difficulty finding

$action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');

....It is on line 18 of admin/categories.php in my site, so with this mod installed, the first 23 lines of code on that page look like:

<?php
/*
 $Id: categories.php,v 1.146 2003/07/11 14:40:27 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 require(DIR_WS_CLASSES . 'currencies.php');
 $currencies = new currencies();

 $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');

// Ultimate SEO URLs v2.1
// If the action will affect the cache entries
if ( eregi("(insert|update|setflag)", $action) ) include_once('includes/reset_seo_cache.php');

 

Hope that helps!

Share this post


Link to post
Share on other sites

I need to uninstall the contrib. I have undo the instructions and now my home

page is blank.

 

Could anyone tell me how to uninstall it properly ?

Database things to delete?

 

Thank you, is urgent. :(

Share this post


Link to post
Share on other sites

Thank you but in my categories.php on line 18 stand this

First kine is line 18

 if ($HTTP_GET_VARS['action']) {
switch ($HTTP_GET_VARS['action']) {
  case 'setflag':
	if ( ($HTTP_GET_VARS['flag'] == '0') || ($HTTP_GET_VARS['flag'] == '1') ) {
	  if ($HTTP_GET_VARS['pID']) {
		tep_set_product_status($HTTP_GET_VARS['pID'], $HTTP_GET_VARS['flag']);
	  }

	  if (USE_CACHE == 'true') {
		tep_reset_cache_block('categories');
		tep_reset_cache_block('also_purchased');
	  }
	}

	tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $HTTP_GET_VARS['cPath']));
	break;
  case 'insert_category':
  case 'update_category':
	$categories_id = tep_db_prepare_input($HTTP_POST_VARS['categories_id']);
	$sort_order = tep_db_prepare_input($HTTP_POST_VARS['sort_order']);

	$sql_data_array = array('sort_order' => $sort_order);

	if ($HTTP_GET_VARS['action'] == 'insert_category') {
	  $insert_sql_data = array('parent_id' => $current_category_id,
							   'date_added' => 'now()');
	  $sql_data_array = tep_array_merge($sql_data_array, $insert_sql_data);
	  tep_db_perform(TABLE_CATEGORIES, $sql_data_array);
	  $categories_id = tep_db_insert_id();
	} elseif ($HTTP_GET_VARS['action'] == 'update_category') {
	  $update_sql_data = array('last_modified' => 'now()');
	  $sql_data_array = tep_array_merge($sql_data_array, $update_sql_data);
	  tep_db_perform(TABLE_CATEGORIES, $sql_data_array, 'update', 'categories_id = \'' . $categories_id . '\'');
	}

Share this post


Link to post
Share on other sites
Addition: I guess I edited the seo_cache.php last time:

 

function strip($convert_me) {
$strip_array = array(""","'",chr(33),chr(34),chr(35),chr(36),chr(37),chr(38),chr(39),chr(40),chr(41),chr(42),chr(43),chr(44),chr(46),chr(47),chr(58),chr(59),chr(60),chr(61),chr(62),chr(63),chr(91),chr(92),chr(93),chr(94),chr(95),chr(96),chr(123),chr(124),chr(125),chr(126) );  
$strip_array2 = array(chr(45)." ");
$convert_me = str_replace($strip_array, '', $convert_me);
$convert_me = str_replace($strip_array2, ' ', $convert_me);
$convert_me = str_replace(array(' ', '  ', '__', '--'), '-', $convert_me);
$convert_me = strtolower($convert_me);
return $convert_me;
 }

 

But

 

$strip_array2 = array(chr(45)." ");

 

doesn't do anything without a space after '-' ... so this doesn't cause the problem ...

 

 

This is one of the "problems" I ran into on my test set up as well.... Has nothing to do with any editing of any files on my part, I just didn't understand all of the settings properly. To correct the missing "-" from URLs generated by Ultimate SEO, go into the admin section for SEO URLs, and change the "Remove all non-alphanumeric characters" setting to "false". After that, go to the next setting below and reset theSEO URLs cache to clear out the previously generated URLs. This will cause SEO URLs to generate the way you're looking for ("product-name-etc-etc-p-1" instead of "productnameetcetc-p-1").

 

Believe it or not, I actually found this information included with the contrib, in the install.html file configuration section. :blush:

 

-Manica, regarding your last post:

Thank you but in my categories.php on line 18 stand this

First kine is line 18

  if ($HTTP_GET_VARS['action']) {
switch ($HTTP_GET_VARS['action']) {
case 'setflag':
if ( ($HTTP_GET_VARS['flag'] == '0') || ($HTTP_GET_VARS['flag'] == '1') ) {
if ($HTTP_GET_VARS['pID']) {
tep_set_product_status($HTTP_GET_VARS['pID'], $HTTP_GET_VARS['flag']);
}

 

The code you are showing here is starting from line 25 in my categories.php, in other words, the very next few lines beyond what I posted above. If you're looking for where to paste the SEO URLs code, it should go on the lines just before your line 18. If that doesn't work, write back and post the top part of your categories.php and I'll see if I can help.

Share this post


Link to post
Share on other sites
I prefer model in URL instead id. For example: http://www.domain.com/mp3-player-xmodel.html (no: http://www.domain.com/mp3-player-p-42.html)

Can somebody help me?

 

Thanx.

 

Regards from Slovakia.

 

 

Sorry, as far as I understand it, you will not be able to get SEO URLs to work exactly like that. The product information included already can be used for this purpose, i.e. the "xmodel" information can be included in the product title when you enter the product into the catalog so that the url comes out as http://www.domain.com/mp3-player-xmodel-p-42.html ... HOWEVER, the "-p-42' part is necessary because the current version of SEO URLs requires this information to be present in order for the mod-rewrite functionality to work on your server (i.e. the mod_rewrite functions added to your .htaccess file)... Without that, the rewrite URL would not work correctly.

 

Darn, I wish Chemo wasn't banned... He's probably already got a better fix in place by now :rolleyes:

Share this post


Link to post
Share on other sites
Sorry, as far as I understand it, you will not be able to get SEO URLs to work exactly like that. The product information included already can be used for this purpose, i.e. the "xmodel" information can be included in the product title when you enter the product into the catalog so that the url comes out as http://www.domain.com/mp3-player-xmodel-p-42.html ... HOWEVER, the "-p-42' part is necessary because the current version of SEO URLs requires this information to be present in order for the mod-rewrite functionality to work on your server (i.e. the mod_rewrite functions added to your .htaccess file)... Without that, the rewrite URL would not work correctly.

 

I think -p- is for unique URL address, but Products Name + Products Model is unique too and better for SEO.

Share this post


Link to post
Share on other sites

Hi, I cann't seem to get it to work.

 

I'm trying to implement it locally (Windows machine with XAMPP), but there is a problem with the .htaccess file (i guess).

 

It generates this error:

 

Server error!

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.

If you think this is a server error, please contact the webmaster.
Error 500
localhost
01/19/06 19:05:31
Apache/2.0.55 (Win32) mod_ssl/2.0.55 OpenSSL/0.9.8a PHP/5.0.5 mod_autoindex_color

 

I have have removed the

"Options +FollowSymLinks" line but that did not help.

 

This is my .htaccess file:

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

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}

It is installed in C:\xampp\htdocs\catalog.

 

Any help is appreciated

 

Other contri's I have installed are STS, SEO meta tags.

Thanks, Martijn

Edited by Sickboards

Share this post


Link to post
Share on other sites

I Just upgraded to latest version of SEO Urls, 2.1d. It is working fine except clicking the product on the product page results in a 404 error: The requested URL /catalog/roving-pi-29.html was not found on this server. This problem only effects the popup images, all other images display properly.

Version 1 of SEO Urls worked fine but it was more than a year old.

Any ideas?

Share this post


Link to post
Share on other sites

404 Error Problem

 

I am having a similar problem as reported by several people on this thread. But I have not been able to find a solution.

 

I have installed V2.1d and the dynamic HTML urls are generated but I get a 404 error when i click the link.

 

example

http://toronetworks.com/torostore/catalog/...-2002-p-28.html

 

On other links like categories I get redirected to the root index page.

 

I have a feeling these problems are all related to the .htaccess file. but have not been able to pinpoint them.

I have checked to make sure its CHMOD 777 and have tried with

"options +FollowSymLinks" removed.

 

I never had .htaccess file in the catalog directory of if I did it wasnt showing and overwrote it mistakenly.

 

My backed up version of my store however does not show .htaccess file and I assuming therefore there was none in the /catalog/ directory of my server

 

My server is running FreeBSD

 

Contributions I have installed:

On The Fly Autothumbnails

Main Catagories

Quantity Price Breaks and Volume Pricing

CoolMenus

 

I am hoping someone can shed some light.

 

Thank you

Share this post


Link to post
Share on other sites

You're right...the issue is related to the .htaccess files that reside in each directory. For your site it look there are going to be 3 files that you'll have to check. The first is in the root...second in the torostore...and the last one in the catalog directory.

 

The behaviour of .htaccess files is cascading. For example, you can (and probably do) have conflicting rewrite rules in one or more of those .htaccess files.

 

Download each of the files and post them here (making sure to denote which directory each came from). Let's see if we can get this worked out for you.

Share this post


Link to post
Share on other sites
I Just upgraded to latest version of SEO Urls, 2.1d. It is working fine except clicking the product on the product page results in a 404 error: The requested URL /catalog/roving-pi-29.html was not found on this server. This problem only effects the popup images, all other images display properly.

Version 1 of SEO Urls worked fine but it was more than a year old.

Any ideas?

Make sure that you have that rewrite rule in your .htaccess file. The v2.X contribution rewrites more pages than just the categories and product pages...so be sure that you also updated your .htaccess file to accomodate these extra pages.

Share this post


Link to post
Share on other sites
You're right...the issue is related to the .htaccess files that reside in each directory. For your site it look there are going to be 3 files that you'll have to check. The first is in the root...second in the torostore...and the last one in the catalog directory.

 

The behaviour of .htaccess files is cascading. For example, you can (and probably do) have conflicting rewrite rules in one or more of those .htaccess files.

 

Download each of the files and post them here (making sure to denote which directory each came from). Let's see if we can get this worked out for you.

 

Wow thanks for the fast response.

I checked with WS_FTP with all files showing and the only .htaccess file I have is the one in my catalog directory.

 

I noticed also that when in the oscommerce, "www" is removed from my webaddress.

 

Here is the last version of .htaccess file I was attempting to use. I copied it from a post in this thread.

 

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

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}

 

Thanks

 

 

again

Share this post


Link to post
Share on other sites
...

I checked with WS_FTP with all files showing and the only .htaccess file I have is the one in my catalog directory.

...

If you have checked each directory and the only one present is in the catalog directory try these settings:

Options +FollowSymLinks
RewriteEngine On
RewriteBase /torostore/catalog/

The rewrite rules look good but the base is not correct.

Share this post


Link to post
Share on other sites
If you have checked each directory and the only one present is in the catalog directory try these settings:

Options +FollowSymLinks
RewriteEngine On
RewriteBase /torostore/catalog/

The rewrite rules look good but the base is not correct.

 

Yes!!!! Thanks that did the trick.

 

Question, If I move my store to the root directory what would the rewrite base look like then just remove "/torostore/catalog/"?

 

Thanks alot Devx

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

×