Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Ultimate SEO URLs - by Chemo


Guest

Recommended Posts

  • Replies 1.9k
  • Created
  • Last Reply

Top Posters In This Topic

Ultimate SEO worked fantastic on my test server but once implemented on my domains a problem occured with the cache. I have multiple virtual domains on a shared server set up in the usual way like the following:

 

/root/httpd/vhosts/domain1.com/httpdocs/catalog/

/root/httpd/vhosts/domain2.com/httpdocs/catalog/

 

All using the same database & image folder

 

The cache is in the catalog folder so when I set it up in admin with the path as:

/root/httpd/vhosts/domain1.com/catalog/cache

it works fine for the domain1 site but when I go to another domain I get the following error:

 

Warning: fopen(): open_basedir restriction in effect. File(/root/httpd/vhosts/domain1.com/httpdocs/catalog/cache/seo_english.cache) is not within the allowed path(s): (/root/httpd/vhosts/domain2.com/httpdocs:/tmp) in /root/httpd/vhosts/domain2.com/httpdocs/catalog/includes/seo_cache.php on line 159

Warning: fopen(/root/httpd/vhosts/domain1.com/httpdocs/catalog/cache/seo_english.cache): failed to open stream: Operation not permitted in /root/httpd/vhosts/domain2.com/httpdocs/catalog/includes/seo_cache.php on line 159

Warning: fwrite(): supplied argument is not a valid stream resource in /root/httpd/vhosts/domain2.com/httpdocs/catalog/includes/seo_cache.php on line 160

Warning: fclose(): supplied argument is not a valid stream resource in /root/httpd/vhosts/domain2.com/httpdocs/catalog/includes/seo_cache.php on line 161

Warning: main(): open_basedir restriction in effect. File(/root/httpd/vhosts/domain1.com/httpdocs/catalog/cache/seo_english.cache) is not within the allowed path(s): (/root/httpd/vhosts/domain2.com/httpdocs:/tmp) in /root/httpd/vhosts/domain2.com/httpdocs/catalog/includes/seo_cache.php on line 164

Warning: main(/root/httpd/vhosts/domain1.com/httpdocs/catalog/cache/seo_english.cache): failed to open stream: Operation not permitted in /root/httpd/vhosts/domain2.com/httpdocs/catalog/includes/seo_cache.php on line 164

Warning: main(): open_basedir restriction in effect. File(/root/httpd/vhosts/domain1.com/httpdocs/catalog/cache/seo_english.cache) is not within the allowed path(s): (/root/httpd/vhosts/domain2.com/httpdocs:/tmp) in /root/httpd/vhosts/domain2.com/httpdocs/catalog/includes/seo_cache.php on line 164

Warning: main(/root/httpd/vhosts/domain1.com/httpdocs/catalog/cache/seo_english.cache): failed to open stream: Operation not permitted in /root/httpd/vhosts/domain2.com/httpdocs/catalog/includes/seo_cache.php on line 164

Warning: main(): Failed opening '/root/httpd/vhosts/domain1.com/httpdocs/catalog/cache/seo_english.cache' for inclusion (include_path='.:/php/includes') in /root/httpd/vhosts/domain2.com/httpdocs/catalog/includes/seo_cache.php on line 164

 

is thhere anyway round this problem?

Link to comment
Share on other sites

is thhere anyway round this problem?

Yes...in application_top.php (for each domain that is not going to use the database value) at the very top add this code:

define('SEO_URLS_CACHE_DIR', '/your/new/path/');
define('SEO_URLS_CACHE_COMPRESS', 'true');

Make sure you put it at the TOP of application_top.php! This will override the database value and all should be well...you'll be able to define the cache directory per domain.

 

Bobby

Link to comment
Share on other sites

Yes...in application_top.php (for each domain that is not going to use the database value) at the very top add this code:

define('SEO_URLS_CACHE_DIR', '/your/new/path/');
define('SEO_URLS_CACHE_COMPRESS', 'true');

Make sure you put it at the TOP of application_top.php!  This will override the database value and all should be well...you'll be able to define the cache directory per domain.

 

Bobby

 

 

Works a treat :D Thanks again

Link to comment
Share on other sites

KJ Miller,

 

If you have run the database install script twice and now have 2 entries for SEO URLs re-run the install script and choose the uninstall link.

 

This will remove both sets of entries.

 

Next, run the install script again to install a single setting group.  Fill in the correct configuration values again.  In the future, there is no need to run the install database settings script unless it has not been run previously.

 

The extra steps are for the buy now button and column.  It has been reported on this thread there are 2 bugs which that code corrects.

 

I have several instant messenger accounts (AIM, MSN, and Yahoo) and can usually be found online...just contact me and I'll walk you through any other issues.

 

Bobby

 

Hi Bobby,

Did that and it removed like you said, I reinstalled and setup. All good.... Maybe you should alter your html instruction page under "Upgrade" as you have this step in there. That would help any future upgraders.

 

Now for my question (hey, great contribs get this i guess)

I changed some dir names in my "Categories". I deleted the english cache file that was in the cache and refreshed but the url paths were still the old names?

 

Thanks for your input.

KJ

define('PROJECTS', 'Something that goes on forever!');

Link to comment
Share on other sites

Could it be that the categories box is still cached? Go to Admin Contol Panel -> Cache Control -> Rest each cache file.

 

That should take care of it...

 

Bobby

Link to comment
Share on other sites

Could it be that the categories box is still cached?  Go to Admin Contol Panel -> Cache Control -> Rest each cache file.

 

That should take care of it...

 

Bobby

 

Dat was it! I just triggered use cache to "false". Your good! very good and quick I might add. :thumbsup: Should I keep this to false?

 

It will be interesting to see how my listings change in the SE's (patient of course!)

 

Thanks again, KJ

define('PROJECTS', 'Something that goes on forever!');

Link to comment
Share on other sites

Thank you for your kind remarks!

 

I would use cache as it increases performance of each page (less queries). Upon editing a category or product the cache files should automatically be reset...I would look into fixing the root problem so you don't have to reset the cache manually every time.

 

Bobby

Link to comment
Share on other sites

Bobby,

 

I have a question that is a bit off topic (yet still deals with se's and speed)

I have my shop located in a catalog directory and want to set it up so that when someone goes to my site they only put is

 

www.mutzigcreations.com and not www.mutzigcreations.com/catalog

 

I don't want to move the files to the root, and I was wondering if I could tap your experience with the best way to setup the redirect.

 

I found a contribution (spiderfriendly redirect w/o hesitation) and this is what it suggested:

 

Solution.

1. Create a text file and name it index.php

 

2. Copy the code below and paste it in.

Make sure there is nothing else in the document.

Also change the catalog/index.php to the location of your default/index.php oscommerce file.

 

<!-- Start Code -->

<?

header("Location: catalog/index.php");

?>

<!-- End Code -->

 

3. Save the file and upload it to your primary root directoy.

 

I talked with my host and this is what they suggested:

Hello Doug,

I have double checked with a tech and found a better solution, this will do what you ask please disregard the other link and put this into your htaccess file:

RewriteEngine On

Options +FollowSymlinks

 

RewriteCond %{HTTP_HOST} mutzigcreations.com$

RewriteCond %{REQUEST_URI} !catalog/

RewriteRule ^(.*)$ catalog/$1

 

What would you suggest as the easiest, fastest, more seo friendly way of doing it?

 

again sorry to ask here, but I figure others are looking for your insight into this too.

 

RW

Link to comment
Share on other sites

Thank you for your kind remarks!

 

I would use cache as it increases performance of each page (less queries).  Upon editing a category or product the cache files should automatically be reset...I would look into fixing the root problem so you don't have to reset the cache manually every time.

 

Bobby

 

Your welcome and your deserve much credit.

 

hmmm... not even sure I would know where to start? Didn't know I had a problem until now?

 

KJ

define('PROJECTS', 'Something that goes on forever!');

Link to comment
Share on other sites

Go back and take a look at that contribution...I uploaded a correct release for it. The problem with the ones suggested were they sent 302 headers and NOT the proper 301 headers.

 

I would simply add the .htaccess entries as outlined in my revised release of that contribution to the file located in the ROOT directory. The one in the /catalog/ directory should not be touched since it is for the rewrite of the store URLs.

 

Of course, the code offered by your host is another way of redirecting but does not add the 301 headers.

 

Bobby

Link to comment
Share on other sites

Thanks for the info! I can't tell you how much you have helped me (thru your contributions, and your support).

 

RW

Go back and take a look at that contribution...I uploaded a correct release for it.  The problem with the ones suggested were they sent 302 headers and NOT the proper 301 headers.

 

I would simply add the .htaccess entries as outlined in my revised release of that contribution to the file located in the ROOT directory.  The one in the /catalog/ directory should not be touched since it is for the rewrite of the store URLs.

 

Of course, the code offered by your host is another way of redirecting but does not add the 301 headers. 

 

Bobby

Link to comment
Share on other sites

Your welcome and your deserve much credit.

 

hmmm... not even sure I would know where to start? Didn't know I had a problem until now?

 

KJ

The code that you are looking for is located in admin/categories.php and looks like this:

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

It is located in several places so make sure it is in the appropriate switch block.

Thanks for the info!  I can't tell you how much you have helped me (thru your contributions, and your support).

 

RW

Your welcome...one day (maybe even today!) you'll return the favor to some store owner that asks a question on the forum. It's the pay-it-forward thought process...

 

Bobby

Edited by Chemo
Link to comment
Share on other sites

I do try to help out others as much as possible, I know what it is like to start out knowing absolutly nothing about php,mysql, or osc. LOL

 

I can't tell you how much I have learned in the past 6 months playing with this, breaking that etc..

 

I took your advice and downloaded your update to the spiderfriendly contrib. (never had an easier install before!)

 

My site is live! and I thank you very much!

 

RW

 

p.s. check out what you have in part enabled me to do at My Webpage

 

Thanks again!

Link to comment
Share on other sites

Thank you, and yes I have a question out on the forums on it. I am not sure what is the cause of the problem. I thought that by default it would show them..hmm will do more digging.

 

RW

 

Nice site!  However, look at this URL: Pens Category

 

Instead of showing the "No products found" message it should output a list of subcats...might want to look into that.

 

Bobby

Link to comment
Share on other sites

hello chemo,

 

the Promlem of the ?,?,? one could solve perfect in seo_cache.php. ;-)

 

 

However we have a larger problem! We have so far 36,800 URL with google..

http://www.google.de/search?hl=de&q=site%3...p.aubu.de&meta=

 

And all this URL look so out in principle.

 

http://www.shop.aubu.de/catalog/product_in...roducts_id/3441

 

But this left always leads on those product not found - site

 

 

http://www.shop.aubu.de/catalog/audi-a4-st...761-p-3441.html

 

 

Do you have a solution for the problem???

 

Thank you for the assistance

 

Boergi

Link to comment
Share on other sites

I've installed the upgrade to version 1.2 by Chemo, with Webpixie addition, but I can't see the manufacturers name.

I've installed also this contribution: http://www.oscommerce.com/community/contributions,2192

I don't know how make modify into product_listing.php: someone help me?

Skype: centoasa

Skype: remigioruberto

Link to comment
Share on other sites

I'm sorry: I can see the name of manufactures.

I thought that the name was looked from the manufacturers dropdown.

It's possible?

 

Posted by Bobby in an earlier post (page 5) of this thread....

That is a known issue IF you use the dropdown menu. If you use the dropdown it constructs the URL's through other code and does NOT use tep_href_link() which is the heart of the Ultimate SEO URLs contribution. I will post code to get those worked out. I did not get it in the current release since I wanted to get feedback on the functionality of the basics before adding other areas...it makes for easier and faster debugging that way.

define('PROJECTS', 'Something that goes on forever!');

Link to comment
Share on other sites

Hi, guys

 

Installed this contrib... works like a Swiss watch. Now, eeee, I have one stupid q: How many files should be in the cache directory? :blush: I have only one file - seo_english.cache. Is that OK?

 

Thanks

Link to comment
Share on other sites

Bobby, Thank you for the Ultimate SEO contribution :-D it is truly awesome!

 

I have two questions for you about duplicate URLs:

1. Froogle Data Feed

Does your Data Feed contribution submit stock osC URLs for product pages, similar to the basic Froogle Exporter?

If so, it there a way to submit Ultimate SEO URLs?

 

2. Site Map MS2-2.2 (abstracted from 2.2-MS3 CVS snapshot)

This excellent Site map displays sub-category URLs as standard osC format, Example: Pens Site Map

I tried including sitemap.php in your .htaccess, but it did not change anything. Does a reference to Ultimate SEO need to be included in the classes file used for building the category tree " included/classes/category_tree.php"?

 

Again, many thanks for your contributions.

With kind regards,

EricK

Link to comment
Share on other sites

I installed the Ultimate SEO URL contrib a couple of days ago. It seemed to be working fine. But I did discover a problem yesterday.

 

When adding products, a few go through OK, then I started getting "Page cannot be found". Then, after a while it might let me add another product, and then it will stop again. The problem would happen when I would click the "update", "delete" or sometimes even "edit" button. It's very sporadic, sometimes it works, usually it doesn't. And only on the admin side. Any idea why this might happen?

 

also, should the SEO Cache dir. be different then the other Cache dir.?

 

 

Here are my server specs:

 

Server OS: FreeBSD 4.10-SATA-RELEASE

 

HTTP Server: Apache/1.3.27 (Unix)

 

PHP Version: 4.3.4 (Zend: 1.3.0)

 

Database: MySQL 4.0.18

 

I appreciate any help, I would really like to keep this contribution.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...