Jump to content
Latest News: (loading..)
Chemo

[Contribution] Ultimate SEO URLs - by Chemo

Recommended Posts

Bobby tried with me last night to see what the problem was, and between us we were completely stumped. By careful tweaking, I now have (nearly) all the code into my application_top file, and my site still works. The bit which breaks my site every single time i add it in is this line of code:

 

CODE

$cache->get_cache('GLOBAL');

Does anybody have any idea

1) why this causes my site to return a 404 error (which btw is not my servers 404 page but a generic 404 error page...?)

2) why all of a sudden on sunday evening this line decided to cause problems, bearing in mind that I am the only person with access to my server, and I was tucked up in bed...?

 

Anyway, another little glitch I have noticed which may or may not be related is this - when I turn on ultimate SEO's in my control panel, it is nearly impossible to login and order anything on my site as every page returns a brand new session_id - you can log in, look at an item, when you go to add it to basket, the site wants you to login. Now login, the site has forgotten why you wanted to login to begin with! Sure fire way to frustrate customers!! The second you set ultimate seo to off, the sessions remain static and customers can order....

 

Is this all part and parcel of the same issue, and if so what??? I know it is infuriating having large httpd.conf files posted on the forums, so anybody who is interested can pick mine up by instant messaging me - the msn im address is on my member card, or send me a private message through the forum....

 

Update on my progress - (3 weeks into this problem, and still going slowly. Not fixed yet, but theres always hope!). Right - I have re-imaged my server and started from scratch. I have checked and mod_rewrite is installed and working. I have triple checked my configure.php file, and I now dont have ugly sid's all over the place, until you start using the shopping basket (which I think is normal). I have re-installed the cache and seo contributions and I still cannot get this damn thing to work. I have narrowed down the problem a little more, and I believe it lies in this bit of code (as before)

$cache->get_cache('GLOBAL');

which still breaks everything and returns a generic 404 error, but if I change this to

$cache->get_cache('');

, then my site still works, but ultimate seo urls dont. Not being a clever chappy, I cant suss out what "GLOBAL" does or refers to. On the plus side, I have managed to now get Ultimate seo's switched on and sessions to remain intact, so now its just the small matter of getting the urls and links to show correct keywords.......

 

Any help, pointers, advice or thoughts appreciated. After 3 weeks, I have been up to number 1 :thumbsup: in G00gle for countless search terms (basically every single one of my category names) and have now dissappeared completely off the radar again :( . Probably one of the quickest rise and falls in the history of search engine positioning, but I am now getting desperate to get back to No.1! I've tasted success and like the flavour - please help :'(


Please note - if I have suggested a contrib above, it doesnt mean it will work! Most of the contribs are not ones I've used, but may be useful for your particular problem....

Have you tried a refined search? Chances are your problem has already been dealt with elsewhere on the forums.....

if (stumped == true) {

return(square_one($start_over)

} else {

$random_query = tep_fetch_answer($forum_query)

}

Share this post


Link to post
Share on other sites

Tony,

 

It's great to hear from a store owner that the contribution is performing to expectations for search engine results! I've heard nearly 50 pages of bugs, feedback, support, and development but only one or two store owners that report how it is affecting their natural search engine traffic or positioning. Very refreshing indeed to know that it has helped your site get to top search positioning...even if just for a moment.

 

Quick jab at an earilier post from a member: and all that benefit from a contribution that was coded by a douche bag with oversize female genitalia.

 

Do me a quick favor -> downgrade to version 1.4 released on 23 January 2005. The reason is that the backbone of the 2.X releases are the Advanced Cache Class which moves the cache off the filesystem and into the DB. It may be issue with that for your site...so moving it back to the filesystem may allow for slower performance...but slower is better than no performance any day of the week and twice on Sunday.

 

Let me know how it goes!

 

Bobby

Share this post


Link to post
Share on other sites
OK this should fix your problem, if not then you have another issue :) but this is the fix to SEO URL's for this issue....

Edit /includes/function/html_output.php....

 

Find:

$separator = ( tep_not_null($params_stripped) ? '&' : '?' );

 

and replace it with:

 

$separator = ( tep_not_null($params_stripped) || $seo === false ? '&' : '?' );

 

I cant take the credit for this I just pointed out the line to Bobby and what I thought needed to be done but I left it to him think about how he wanted to cancel the switch...

 

C-

 

That did it! Along with the if statement in seo_redirect, the link from the cart now works and keeps the attributes.

 

Are you aware of any contrib's (i've looked) that add the ability to "Update" the attributes of an item already in the cart without having to use the "Add to Cart" button and delete the old item? Not a big deal, I suppose, it just seems like a nice feature...

 

Thanks again for the great contrib and all of the support!


Brian Neuman

Share this post


Link to post
Share on other sites

Hi, Contrib working great, haven't seen any posts on this.

 

When I go to the site for the first time and click on a category or product I get a url will an osCsid

 

http://www.naturalfigure.co.uk/tone-slim-p...7d41e2a866d34e3

 

once I click on a second product or category everything is fine.

 

Obvious one I hope, Alistair


"Know that this is your God, who could not consent to send anyone else to save you, but would come himself that he might gain for himself all your love." St Alphonsus Ligouri

Share this post


Link to post
Share on other sites

this is working as it should be. on the first click a session id is generated - after that it will go away, unless you are not using cookies, in which case the sid will stay appended the whole time. Either way, this is not a problem as long as you have Prevent Spider sessions set to true in your admin, which makes sure google, etc. do not index your site with the sids appended at the end of the urls. make sure to keep the spiders.txt file up to date.

Share this post


Link to post
Share on other sites
Do me a quick favor -> downgrade to version 1.4 released on 23 January 2005. The reason is that the backbone of the 2.X releases are the Advanced Cache Class which moves the cache off the filesystem and into the DB. It may be issue with that for your site...so moving it back to the filesystem may allow for slower performance...but slower is better than no performance any day of the week and twice on Sunday.

 

Hi Bobby. My site is getting a bit bogged down with tweaks and re-tweaks, so have set up a dummy site on a fresh install to make sure that I am not running conflicting code anywhere. On a fresh install, and with just this contrib running, it still comes up with.......standard osc urls! I have tried the original version, 1.3, 1.4 and 2.0. All come up with nothing (except the occassional blank page when using 2.0 and forgetting to change GLOBAL to a blank space). I think you were right way back when I first raised the issue (or was it Chris?) in saying that this is a server setup issue. I have wiped my server and reconfigured it, but still getting no joy. Which part of the httpd.conf refers to the part of your code where GLOBAL is defined? I am fairly certain that this is where my gremlin lies, but I dont have the knowledge (yet) to go and nuke the little bugger!

 

As always, your continued help is greatly appreciated, and in reference to the earlier post regarding female sex organs and shower bags (still not quite sure how calling someone a douche bag is an insult, but maybe thats just me being naiive and/or english...?), some people dont know a good thing when they have it. After all, osC is free, the support forums are free, the contribs are free. When a coder asks for a fee to look at a specific problem, this is surely a very small price to pay for what is probably the most powerful shopping cart software available (at any price). Just my 2 cents, and probably not suitable or relevant to this particular thread, but what the hell - someone else started slinging mud, I feel obliged to get the mop out. ;)


Please note - if I have suggested a contrib above, it doesnt mean it will work! Most of the contribs are not ones I've used, but may be useful for your particular problem....

Have you tried a refined search? Chances are your problem has already been dealt with elsewhere on the forums.....

if (stumped == true) {

return(square_one($start_over)

} else {

$random_query = tep_fetch_answer($forum_query)

}

Share this post


Link to post
Share on other sites

I installed this mod about a month ago and I thought I had it working correctly. The rewrite was working fine and I was so excited ? Thanks Chemo :-). But then I went to purchase a product I got a Forbidden Error. So I had to disable SEO URLs in the Admin since the site is live and has customers.

 

Here is the breakdown. The website is hosted on a shared server at Aplus. I don?t own a SSL certificate, so I use the shared one that comes with the shared server.

 

Here is my site, Ultimate SEO URLs works fine on it when I have it turned on with the rewrite www.mamamaternity.com

 

But when a customer goes to login or checkout, they get redirected to the secure site https://pro16.abac.com/mamamaternity/login.php Now when I have the Ultimate SEO URLs on with Rewrite I get the below error page on checkout

 

Forbidden

You don't have permission to access /mamamaternity/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".

 

I apologize if this is a simple fix, I?m new to .htaccess and spent several days looking in to this. Aplus?s support didn?t really help, they told me Rewrite does not work on their system and that there was no reason for me to need to use it. Though it does work because the products come up fine with the .html extension.

 

Would I need to have a second .htaccess file for the secure server? Any help would be greatly appreciated.

Share this post


Link to post
Share on other sites

Do as the error message says and add the "Options + Indexes" entry to the top of the htaccess file that has the rewrite rules for the store.

 

Bobby

Share this post


Link to post
Share on other sites
I installed this mod about a month ago and I thought I had it working correctly. The rewrite was working fine and I was so excited ? Thanks Chemo :-). But then I went to purchase a product I got a Forbidden Error. So I had to disable SEO URLs in the Admin since the site is live and has customers.

 

Here is the breakdown. The website is hosted on a shared server at Aplus. I don?t own a SSL certificate, so I use the shared one that comes with the shared server.

 

Here is my site, Ultimate SEO URLs works fine on it when I have it turned on with the rewrite www.mamamaternity.com

 

But when a customer goes to login or checkout, they get redirected to the secure site https://pro16.abac.com/mamamaternity/login.php Now when I have the Ultimate SEO URLs on with Rewrite I get the below error page on checkout

 

Forbidden

You don't have permission to access /mamamaternity/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".

 

I apologize if this is a simple fix, I?m new to .htaccess and spent several days looking in to this. Aplus?s support didn?t really help, they told me Rewrite does not work on their system and that there was no reason for me to need to use it. Though it does work because the products come up fine with the .html extension.

 

Would I need to have a second .htaccess file for the secure server?  Any help would be greatly appreciated.

 

 

And I will put my opinion here... find a new host. I have used them and it was a mess, they lost a "registered" domain of my clients mid-term (even thought they paid to buy it - I had to deal with the down time)...

 

and I have migrated all my clients for like over a year and they are still billing me. I personaly thouht the support was some of the worse...

 

OI wish I had checked BBBAbacuse first not after...anyway - it is off topic but if you are doing seriosu hosting I would be scared ;)


osC Contributions I have published.

 

Note: Some I only provided minor changes, updates or additions!

Share this post


Link to post
Share on other sites

Install files not php 4.0.6 compatible.

 

This is the install file for php versions less than 4.2.

 

Replace: $_SERVER with $HTTP_SERVER_VARS

 

and $_GET with $HTTP_GET_VARS

 

<?php
/*-----------------------------------------------------------------------------*\
################################################################################
#
#	Script name: admin/install-seo.php
#	Version: v1.3
#
#	Copyright (C) 2005 Bobby Easland
#	Internet moniker: Chemo
#	Contact: chemo@mesoimpact.com
#
#	This script is free software; you can redistribute it and/or
#	modify it under the terms of the GNU General Public License
#	as published by the Free Software Foundation; either version 2
#	of the License, or (at your option) any later version.
#
#	This program is distributed in the hope that it will be useful,
#	but WITHOUT ANY WARRANTY; without even the implied warranty of
#	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#	GNU General Public License for more details.
#
#	Script is intended to be used with:
#	osCommerce, Open Source E-Commerce Solutions
#	http://www.oscommerce.com
#	Copyright (c) 2003 osCommerce
################################################################################
\*-----------------------------------------------------------------------------*/

require('includes/application_top.php');
$insert_values = array();

$insert_values[] = "DROP TABLE IF EXISTS `cache`";
$insert_values[] = "CREATE TABLE `cache` (
 `cache_id` varchar(32) NOT NULL default '',
 `cache_language_id` tinyint(1) NOT NULL default '0',
 `cache_name` varchar(255) NOT NULL default '',
 `cache_data` mediumtext NOT NULL,
 `cache_global` tinyint(1) NOT NULL default '1',
 `cache_gzip` tinyint(1) NOT NULL default '1',
 `cache_method` varchar(20) NOT NULL default 'RETURN',
 `cache_date` datetime NOT NULL default '0000-00-00 00:00:00',
 `cache_expires` datetime NOT NULL default '0000-00-00 00:00:00',
 PRIMARY KEY  (`cache_id`,`cache_language_id`),
 KEY `cache_id` (`cache_id`),
 KEY `cache_language_id` (`cache_language_id`),
 KEY `cache_global` (`cache_global`)
) TYPE=MyISAM;"
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Install (and Uninstall) Database Table script for osC-Cache - by Chemo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
font-family: Arial, Helvetica, sans-serif;
background-attachment: fixed;
background-image: url(http://forums.oscommerce.com/uploads/av-9196.jpg);
background-repeat: no-repeat;
background-position: right top;
font-size: 12px;
}
-->
</style>
</head>
<body>
<?php
if ( isset($HTTP_GET_VARS['action']) && $HTTP_GET_VARS['action'] == 'install' ){
echo '<p><b>Install option selected...running queries</b></p>';
echo '<p>STEP 1 => Add cache table</p>';
foreach ($insert_values as $index => $value_query){
 tep_db_query($value_query);
 echo "<p>$value_query<blockquote>Success...</blockquote></p>";
}
echo "<a href='".$_SERVER['PHP_SELF']."'><b>All done...back to the index</b></a>";
}
elseif ( isset($HTTP_GET_VARS['action']) && $HTTP_GET_VARS['action'] == 'delete' ){
echo '<p><b>Uninstall option selected...running queries</b></p>';
echo '<p>STEP 1 => Drop cache table</p>';
tep_db_query("DROP TABLE `cache`");
echo "<p>Cache table dropped<blockquote>Success...</blockquote></p>";
echo "<a href='".$_SERVER['PHP_SELF']."'><b>All done...back to the index</b></a>";
}
else {
?>
<p>Welcome to the barebones osC-Cache installation script (<a href="http://forums.oscommerce.com/index.php?showuser=9196">by Chemo</a>)!</p>
<p>This contribution is GPL and the target audience is the advanced developer or store owner. Minimal support will be given for this but I wanted to upload it in case some wanted a copy. </p>
<p>There are two options for this script:</p>
<p><strong>INSTALL</strong></p>
<blockquote>
 <p>This option is self explanatory :) This will add the cache table. </p>
</blockquote>
<p align="center"><a href="<?php echo $HTTP_SERVER_VARS['PHP_SELF']; ?>?action=install"><b>INSTALL</b> THE DATABASE VALUES FOR ULTIMATE SEO URLs</a></p>
<p align="left"><strong>UNINSTALL</strong></p>
<blockquote>
 <p align="left">Hopefully, this option is self-explanatory too :)  This will delete the cache table.</p>
</blockquote>
<p align="center"><a href="<?php echo $HTTP_SERVER_VARS['PHP_SELF']; ?>?action=delete"><b>UNINSTALL</b> THE DATABASE VALUES FOR ULTIMATE SEO URLs</a></p>
<?php
} # End default page
?>
</body>
</html>

 

Hope this helps someone.

Share this post


Link to post
Share on other sites
Do as the error message says and add the "Options + Indexes" entry to the top of the htaccess file that has the rewrite rules for the store.

Bobby

I tried adding "Options + Indexes" and that did not work. I also called aplus and got the runaround from their support department, which is very difficult to work with since their support is oversees and there is a language barrier. They told me it?s my problem and for me to figure it out.

 

I would cancel the service with aplus but I would have to go through my boss and I?m scarred of her. I guess if there is nothing to do to fix this I will just have to save this mod until the contract with aplus expires ☹

 

Thanks Bobby and Chris for taking the time to respond to my question.

Share this post


Link to post
Share on other sites
I tried adding "Options + Indexes" and that did not work.  I also called aplus and got the runaround from their support department, which is very difficult to work with since their support is oversees and there is a language barrier.  They told me it?s my problem and for me to figure it out.

 

I would cancel the service with aplus but I would have to go through my boss and I?m scarred of her. I guess if there is nothing to do to fix this I will just have to save this mod until the contract with aplus expires ☹

 

Thanks Bobby and Chris for taking the time to respond to my question.

 

You could try to contact your sales rep-might have better luck - they "can" put you in touch with local support. But you should prep your boss to go else where.

 

C-


osC Contributions I have published.

 

Note: Some I only provided minor changes, updates or additions!

Share this post


Link to post
Share on other sites

Note: Ultimate SEO URLs Redirect file is not php 4.0.6 compatible.

 

The function ltrim with second parameter is not compatible with pre 4.1.0 PHP.

 

"String ltrim (string str [, string charlist])"

 

This is used in three locations in seo_redirect.php

 

$this->path_info = ltrim(getenv('PATH_INFO'), '/'); // needed for old SEF URLs
	 $this->uri = ltrim( $HTTP_SERVER_VARS['REQUEST_URI'], '/' ); // get the URL from the browser
	 $this->real_uri = ltrim( $HTTP_SERVER_VARS['SCRIPT_NAME'] . '?' . $HTTP_SERVER_VARS['QUERY_STRING'], '/' ); // after rewrite

 

I am looking at alternatives to using the ltrim function as yet I have not found an alternative that works. If anyone has a solution and are wishing to share I would be very grateful.

 

I am looking to apply the Itrim function on the string and then another function to remove the forward slash. Any ideas??

 

Hosting companies that don?t update their PHP can be such a pain!!!! :'(

 

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

Note: this contribution is having some very good results on other sites I am working on. Thanks Chemo and everyone who has contributed to its development. :thumbsup:

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

Share this post


Link to post
Share on other sites
Note: Ultimate SEO URLs Redirect file is not php 4.0.6 compatible.

 

Hosting companies that don?t update their PHP can be such a pain!!!!  :'(

 

 

Maybe time to look for new hosting company...lol I seem to say that alot lately...

 

But all seriously... As new more advanced contributions come out you might be missing out using older PHP versions.

 

4.0.6 is OLD!!!

 

You can work around it but will have to rewrite with a different function like str_replace or something.

 

Chris


osC Contributions I have published.

 

Note: Some I only provided minor changes, updates or additions!

Share this post


Link to post
Share on other sites
Maybe time to look for new hosting company...lol I seem to say that alot lately...

 

But all seriously...  As new more advanced contributions come out you might be missing out using older PHP versions.

 

4.0.6 is OLD!!!

 

You can work around it but will have to rewrite with a different function like str_replace or something.

 

Chris

What do you mean "maybe"???

 

PHP v4.0.6 was released on 23-June-2001. That was almost 4 years ago! What does that say about the hosting company? Either they do not have the capability to upgrade software or don't care to upgrade software. Both are bad characteristics of a web host...especially for an eCommerce site.

 

My recommendation is to switch hosts at your earliest convenience.

 

Bobby

Share this post


Link to post
Share on other sites

Question:

 

Is there any way for the 'rewrite' function of this contribution to generate the name of the .html file not by the 'Products Name' but by the 'Products Model' ?

 

Thanks for the great contribution!

 

Nate

Share this post


Link to post
Share on other sites
Question:

 

Is there any way for the 'rewrite' function of this contribution to generate the name of the .html file not by the 'Products Name' but by the 'Products Model' ?

 

Thanks for the great contribution!

 

Nate

 

It can be done, not sure why you would want to, but you might have a reason... quickly looking at it:

 

This of course whould have to be tested.

 

FYI I am not going to support this mod in this forum thread as it is off topic.

 

Change the query around line 56 to

$product_query = tep_db_query("select products_id, products_model from products where products_status='1'");

 

and around line 61 change

strip($product['products_name'])

to:

strip($product['products_model'])

 

Chris


osC Contributions I have published.

 

Note: Some I only provided minor changes, updates or additions!

Share this post


Link to post
Share on other sites

Hello Everyone,

 

I am really interested in getting this contribution to work. I have tried to install v 2.0b using the install pages but they did not seem to work so I added the tables using mysql control center. I verified that the tables matched the strings and redid the pages 3 times. I have read through this topic and have checked my cookie settings and cache settings as well as disabled the sef.

 

For whatever reason the pages are not being shown as cname or pname they still are in the cPath=26&products_id=56 format. Any help with this matter would be greatly appreciated.

 

Info

Windows server

PHP 4.05

MySql 4.0.17

 

website : http://www.houseofswords.com

 

Thanks for your time

Barry

Share this post


Link to post
Share on other sites
Hello Everyone,

 

I am really interested in getting this contribution to work. I have tried to install v 2.0b using the install pages but they did not seem to work so I added the tables using mysql control center. I verified that the tables matched the strings and redid the pages 3 times. I have read through this topic and have checked my cookie settings and cache settings as well as disabled the sef.

 

For whatever reason the pages are not being shown as cname or pname they still are in the cPath=26&products_id=56 format. Any help with this matter would be greatly appreciated.

 

Info

Windows server

PHP 4.05

MySql 4.0.17

 

website : http://www.houseofswords.com

 

Thanks for your time

Barry

 

Problem with install file for php versions less than 4.2.

 

Replace: $_SERVER with $HTTP_SERVER_VARS

 

and $_GET with $HTTP_GET_VARS in the install files... see my last two posts in this thread.

Share this post


Link to post
Share on other sites
Problem with install file for php versions less than 4.2.

 

Replace: $_SERVER with $HTTP_SERVER_VARS

 

and $_GET with $HTTP_GET_VARS in the install files... see my last two posts in this thread.

 

Thanks Gareth,

 

I really appreciate the help. That did get the install to work but the site is still not displaying the cnames or pnames. I did enable the seo urls and am using cname because its a windows server.

 

Thanks again for your help. Any ideas?

 

Barry

Share this post


Link to post
Share on other sites
Thanks Gareth,

 

I really appreciate the help. That did get the install to work but the site is still not displaying the cnames or pnames. I did enable the seo urls and am using cname because its a windows server.

 

Thanks again for your help. Any ideas?

 

Barry

 

 

Update your PHP.

 

There are most likely other functions that will not work on such an old php.


osC Contributions I have published.

 

Note: Some I only provided minor changes, updates or additions!

Share this post


Link to post
Share on other sites

:thumbsup: Wahoo!!!!

 

For those of you who have noticed my numerous posts regarding this contribution working on my store with fantastic results, then switching itself off with disastrous results, after 3 and a bit weeks I have found the solution, and like most things, it was incredibly simple.

 

I had installed the configuration_cache mod, which is fairly common, but of course didn't have the seo configuration group included in its tables. During my install of that mod I had omitted the self updating part, meaning that my store wasnt even attempting to pick up whether or not ultimate seo's was turned on, but when the code was in place was causing confusion for the server.

 

I found this out kind of by accident as I had to re-upload my site to my server and forgot to create my config_cache folder. As soon as I created it (empty of course), the ultimate seo's came back to life!!

 

Of course, I may be the only imbecile who has done this, but just incase others are finding they cannot get this contribution to work, just check to see if you have configuration_cache installed, and if you do, just delete your cached file and let the site create a new one. About 5 seconds work, but well worth it!!

 

Thanks to all who have suggested various different possibilities, especially Chemo, and hopefully my nightmare experience will help somebody else avoid the same problem. :D


Please note - if I have suggested a contrib above, it doesnt mean it will work! Most of the contribs are not ones I've used, but may be useful for your particular problem....

Have you tried a refined search? Chances are your problem has already been dealt with elsewhere on the forums.....

if (stumped == true) {

return(square_one($start_over)

} else {

$random_query = tep_fetch_answer($forum_query)

}

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

×