Jump to content
spidometrs

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

Recommended Posts

ok

 

here the fonction:

how to change ? ... please :-"

REPLACE

header('Location: ' . $url);

WITH

$url = str_replace('&', '&', $url);
header('Location: ' . $url);

Share this post


Link to post
Share on other sites

Hi,

I'm having the following problem with version 2.1d_Updated:

I have a category CDs. Inside are categories like A-D, E-H, I-L, M-P, Q-T,U-Z

Only category M-P gives respons: "Product not found! "

 

All other categories work. Also other main categories like clothing, tapes, vinyl etc etc.

Why does only this one show nothing?

Thanks

Edited by Mercatvs

Share this post


Link to post
Share on other sites

REPLACE

header('Location: ' . $url);

WITH

$url = str_replace('&', '&', $url);
header('Location: ' . $url);

 

 

Thank you FWR Media

 

ist work fine, now :rolleyes:

Share this post


Link to post
Share on other sites

Hi All,

 

I've really tried to figure this out without posting to the forums, but these threads and documentaton has been difficult to follow.

 

Anyway, I installed xyz version of SEO URL

 

On step 4 is says to install some code after:

 

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

 

in my admin/categories.php file.

 

Problem is nothing like that line of code exists in my admin/categories. I installed the code where I thought it probably belonged but I'm thinking I didn't get it right.

 

Everything seems to be ok, except that actual prodcts are not displaying. The store works fine browsing main pages and category pages, but anytime I try to view a product page, IE just spins and spins and spins.

 

Any ideas? The site is www.GameRoom-Supplies.com/

 

Thanks all,

Chris Hackett

Share this post


Link to post
Share on other sites
Hi All,

 

I've really tried to figure this out without posting to the forums, but these threads and documentaton has been difficult to follow.

 

Anyway, I installed xyz version of SEO URL

 

On step 4 is says to install some code after:

 

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

 

in my admin/categories.php file.

 

Problem is nothing like that line of code exists in my admin/categories. I installed the code where I thought it probably belonged but I'm thinking I didn't get it right.

 

Everything seems to be ok, except that actual prodcts are not displaying. The store works fine browsing main pages and category pages, but anytime I try to view a product page, IE just spins and spins and spins.

 

Any ideas? The site is www.GameRoom-Supplies.com/

 

Thanks all,

Chris Hackett

 

In all versions of oscommerce the first few lines of code are ..

 

  require('includes/application_top.php');

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

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

Share this post


Link to post
Share on other sites

If i wanted to add the category name to the URL string, what would i have to do?

 

 

i.e: instead of

 

example.com/pair-of-brown-leather-shoes-p-26.html

 

would become

 

example.com/mens-shoes-c-2/pair-of-brown-leather-shoes-p-26.html

 

 

Im guessing i would have to edit both the tep_validate_seo_urls() function and the .htaccess file?

 

Any help or pointers greatly appreciated.

Share this post


Link to post
Share on other sites

Hi all,

 

I had a bug with an infinite loop of redirections,

on http://www.xxxxxxx.com/catalog/index.php?products_id=4650

this link appeared on a "buy now" button on cross selling items

 

seo should rewrites this link to s05myprod-p-4650.html

unfortunately it does not rewrites to this new form,

it detects that this link should be rewritten

check_seo_page() and need_redirect() says true "index.php" is in $seo_pages

but href_link and parse_parameters does not consider that "index.php" is not rewritable

so seo redirects to the same url

a fix : it should not do_redirect() on an unchanged url to avoid looping

 

my real fix : seo should rewrite url for index.php,

 

I added the case ( $page == FILENAME_DEFAULT && !$this->is_attribute_string($p2[1]) ):

 

in seo.class.php around line 790

 

function parse_parameters($page, $params, &$separator){
[...]
   switch ($p2[0]){ 
       case 'products_id':
           switch(true){
           case ( $page == FILENAME_PRODUCT_INFO && !$this->is_attribute_string($p2[1]) ):
           case ( $page == FILENAME_DEFAULT && !$this->is_attribute_string($p2[1]) ): //GK clic-france.com may2008

 

the same bug should appear for FILENAME_POPUP_IMAGE

 

Thanks for this contribution :-) GuyK

Share this post


Link to post
Share on other sites
Hi all,

 

I had a bug with an infinite loop of redirections,

on http://www.xxxxxxx.com/catalog/index.php?products_id=4650

this link appeared on a "buy now" button on cross selling items

 

seo should rewrites this link to s05myprod-p-4650.html

unfortunately it does not rewrites to this new form,

it detects that this link should be rewritten

check_seo_page() and need_redirect() says true "index.php" is in $seo_pages

but href_link and parse_parameters does not consider that "index.php" is not rewritable

so seo redirects to the same url

a fix : it should not do_redirect() on an unchanged url to avoid looping

 

my real fix : seo should rewrite url for index.php,

 

I added the case ( $page == FILENAME_DEFAULT && !$this->is_attribute_string($p2[1]) ):

 

in seo.class.php around line 790

 

function parse_parameters($page, $params, &$separator){
[...]
   switch ($p2[0]){ 
       case 'products_id':
           switch(true){
           case ( $page == FILENAME_PRODUCT_INFO && !$this->is_attribute_string($p2[1]) ):
           case ( $page == FILENAME_DEFAULT && !$this->is_attribute_string($p2[1]) ): //GK clic-france.com may2008

 

the same bug should appear for FILENAME_POPUP_IMAGE

 

Thanks for this contribution :-) GuyK

 

Looks like the bug is in your code because it is not in ULTIMATE SEO URLs

Share this post


Link to post
Share on other sites
In all versions of oscommerce the first few lines of code are ..

 

  require('includes/application_top.php');

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

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

 

Huh ... that's really interesting, here are the first lines of my admin/catalog.php

 

<?php
/*
 $Id: categories.php,v 1.2 2004/03/29 00:18:17 ccwjr Exp $

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/
global $groupcnt;

require('includes/application_top.php');

// RCI code start
echo $cre_RCI->get('global', 'top');
echo $cre_RCI->get('categories', 'top'); 
// RCI code eof 

require_once('includes/functions/categories_description.php');

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

//intilize varibles
$groupcnt = 0; 
$categories_id = '';
$Push = '';
$categories_head_keywords_tag = '';

 

I knew that CRE was slightly different from OSC, but I thought that CRE was built on top of CRE and basically just had some of the more popular mods installed. Speaking of which, where is this mod in the CRE version? I'm wondering if I would have been better off starting out with OSC instead of CRE...

 

Thanks for your help. I did eventually see something where there were some messages stating that this version that I installed was buggy, broken, or documented not to work, and that I should install 2.1d or something like that? Should I rollback and install a different version of this?

 

Thanks for your help, I really appreciate it.

 

Chris Hackett

Share this post


Link to post
Share on other sites
Huh ... that's really interesting, here are the first lines of my admin/catalog.php

 

<?php
/*
 $Id: categories.php,v 1.2 2004/03/29 00:18:17 ccwjr Exp $

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/
global $groupcnt;

require('includes/application_top.php');

// RCI code start
echo $cre_RCI->get('global', 'top');
echo $cre_RCI->get('categories', 'top'); 
// RCI code eof 

require_once('includes/functions/categories_description.php');

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

//intilize varibles
$groupcnt = 0; 
$categories_id = '';
$Push = '';
$categories_head_keywords_tag = '';

 

I knew that CRE was slightly different from OSC, but I thought that CRE was built on top of CRE and basically just had some of the more popular mods installed. Speaking of which, where is this mod in the CRE version? I'm wondering if I would have been better off starting out with OSC instead of CRE...

 

Thanks for your help. I did eventually see something where there were some messages stating that this version that I installed was buggy, broken, or documented not to work, and that I should install 2.1d or something like that? Should I rollback and install a different version of this?

 

Thanks for your help, I really appreciate it.

 

Chris Hackett

 

Hi Chris

 

Install 2.1d updated

 

For CRE put that (admin/categories) code directly above ..

 

  if (isset($_GET['action'])) {

 

Also CRE hardcodes in a lot of & which causes problems so look back a few posts to where I mention the tep_redirect mod for & and apply that or it won't work.

 

Also in includes/classes/seo.class.php

 

Search for ..

		function href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true){

 

Replace with ..

 

		function href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true){
			$parameters = str_replace('&', '&', $parameters);

 

And yes imo you'd have been far better of with a well modded osc rather than what is (again imo) the spagetti like CRE code.

Edited by FWR Media

Share this post


Link to post
Share on other sites

I have had this Ultimate SEO URLs on my site since I first put it up. My product urls look like this

http://grunionmoto.com/spy-haymaker-sunglasses-p-426.html

 

but my category products dont have the category name in them...

 

http://grunionmoto.com/-c-1_90_91.html

 

I tried this

http://addons.oscommerce.com/info/5738

but besides not making my category names show up it breaks all my category pages when turned on.... What do I need to do to get the category name to show up in the url?

Share this post


Link to post
Share on other sites

Took me a while to figure things out, but I followed these instructions, and it looks like everything is working now.

 

I really appreciate the help. Thank you very much.

 

Chris Hackett

 

 

Hi Chris

 

Install 2.1d updated

 

For CRE put that (admin/categories) code directly above ..

 

  if (isset($_GET['action'])) {

 

Also CRE hardcodes in a lot of & which causes problems so look back a few posts to where I mention the tep_redirect mod for & and apply that or it won't work.

 

Also in includes/classes/seo.class.php

 

Search for ..

		function href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true){

 

Replace with ..

 

		function href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true){
			$parameters = str_replace('&', '&', $parameters);

 

And yes imo you'd have been far better of with a well modded osc rather than what is (again imo) the spagetti like CRE code.

Share this post


Link to post
Share on other sites
I have had this Ultimate SEO URLs on my site since I first put it up. My product urls look like this

http://grunionmoto.com/spy-haymaker-sunglasses-p-426.html

 

but my category products dont have the category name in them...

 

http://grunionmoto.com/-c-1_90_91.html

 

I tried this

http://addons.oscommerce.com/info/5738

but besides not making my category names show up it breaks all my category pages when turned on.... What do I need to do to get the category name to show up in the url?

 

Sounds like a server upgrade and a non compatible version of USU.

 

I suggest upgrading to 2.1d updated.

Share this post


Link to post
Share on other sites

Hi Rob

 

Thanks for your reply. I found the function tep_redirect($url) hack in an attempt to correct the error before I posted in the forum but I did not think that it would help as my URLS do not contain an &amp

 

However the tep_redirect($url) hack HAS corrected the problem with xampp.

 

I have now uploaded Ultimate SEO URLs - 2.1d to my webspace and it is working correctly without the hack so it seems that xampp is the cause of the problem.

 

The main thing is that it is working correctly on the website.

 

Thanks for you help

 

Ken.

Share this post


Link to post
Share on other sites
Sounds like a server upgrade and a non compatible version of USU.

 

I suggest upgrading to 2.1d updated.

 

 

It seems that you are correct. On my other site that I recently transferred to the same server the old urls are working fine but when I add a new category the urls are showing me -c-'s.... I will attempt an upgrade... thanks

Share this post


Link to post
Share on other sites
i have a problem.

the links in my website are not a seo url. they are like this: http://www.site.com/index.php?cPath=3_10 (DVD Movie - Action category)

only when i go to this category, the url will become: http://www.site.com/movies-cartoons-c-3_13.html

the products info page urls have the same problem.

how to solve it?

thanks first

 

1) Reset your categories cache

 

2) If that doesn't work then your categories are probably hardcoded and are not using the correct tep_href_link function.

Share this post


Link to post
Share on other sites

please how to do?

 

1) Reset your categories cache

 

2) If that doesn't work then your categories are probably hardcoded and are not using the correct tep_href_link function.

Share this post


Link to post
Share on other sites

Hello Bobby or anyone,

 

My name is Michael. My website is MostBuys.net. I am hoping that you can help me. I am very new at making changes to these files.

 

Using the most recent update "Ultimate SEO URLs Version 2.1e"

 

Ultimate SEO URLs Version 2.1e

 

 

Step 1:

 

(I made these change with no problems, hopefully)

 

 

But then with Step 2, my ".htaccess" file has none of the inform in there that requires me to locate and add the new changes to. I will list at the bottom what it actually has in there.

 

I am using osCommerce Online Merchant v2.2 RC1, PHP Version 5.2.3. Will this "Ultimate SEO URLs Version 2.1e" work with my OSC version?

 

Step 2:

In the file catalog/.htaccess

 

Find these lines at the top:

 

RewriteEngine On RewriteBase /catalog/

and add these lines after: (before the first RewriteRule)

 

RewriteCond %{QUERY_STRING} ^options\=(.*)$RewriteRule ^(.*)-p-(.*).html$ product_info.php?products_id=$2%1

 

 

What's in my ".htaccess" folder:

 

# $Id: $

#

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

 

# If Search Engine Friendly URLs do not work, try enabling the

# following Apache configuration parameter

 

# AcceptPathInfo On

 

# Fix certain PHP values

# (commented out by default to prevent errors occuring on certain

# servers)

 

# php_value session.use_trans_sid 0

# php_value register_globals 1

Share this post


Link to post
Share on other sites
i still have a question.

when i first my site( i clear ie cache before). the links will be like this:

http://www.site.com/software-simulation-c-...a88bfaee2402fe5

but when i click one of links and in the new page. the links will be like this:

http://www.site.com/software-simulation-c-2_18.html

is it normal?

or how to solve this problem?

 

Perfectly normal

Share this post


Link to post
Share on other sites

when i turn off ultimate seo in admin side

 

my site, dont work

 

i test in local with "xampp"

 

when i click on any product ... firefox or explorer cant find anything

 

any idea please :blush:

Share this post


Link to post
Share on other sites
when i turn off ultimate seo in admin side

 

my site, dont work

 

i test in local with "xampp"

 

when i click on any product ... firefox or explorer cant find anything

 

any idea please :blush:

 

Yup

 

You changed the tep_href_link function in functions/general.php when you installed the contribution.

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

×