Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Ultimate SEO URLs - by Chemo


Guest

Recommended Posts

That?s the problem. Thank you very much Paul. :blush:

 

 

No problem yoclaudio, glad I could be of some simple assistance. :D

 

I do that error a lot. ;) So, it was real familiar.

 

Now, any time I get a "headers already sent" error, I almost have it changed before the site page completes loading. :D

 

Paul

 

PS. what are you using for an editor? Just curious.

Link to comment
Share on other sites

  • Replies 1.9k
  • Created
  • Last Reply

Top Posters In This Topic

No problem yoclaudio, glad I could be of some simple assistance. :D

 

I do that error a lot. ;) So, it was real familiar.

 

Now, any time I get a "headers already sent" error, I almost have it changed before the site page completes loading. :D

 

Paul

 

PS. what are you using for an editor? Just curious.

 

:blink: Now the links doesn?t work, it goes to error HTTP 404, do you know why?

 

I use dreamweaver or notepad, it?s ok?

 

Thanks again

Link to comment
Share on other sites

:blink: Now the links doesn?t work, it goes to error HTTP 404, do you know why?

 

I use dreamweaver or notepad, it?s ok?

 

Thanks again

 

Probably your .htaccess file.

 

Make sure you make the change that is commented on in the .htaccess change.

 

As Bobby said.

 

 

Go back and verify that you did indeed make the changes...the code should look like this:

 

RewriteEngine On
RewriteBase /
# or, RewriteBase /catalog/ depending on if it is root or folder install
RewriteRule ^(.*)-p-(.*).html$ product_info.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-c-(.*).html$ index.php?cPath=$2&%{QUERY_STRING}

 

And post a link too. If you are still having probs.

 

Paul

Edited by Fourbit
Link to comment
Share on other sites

LOL, glad to see it isn't just me :blush:

 

RW

 

No problem yoclaudio, glad I could be of some simple assistance. :D

 

I do that error a lot. ;) So, it was real familiar.

 

Now, any time I get a "headers already sent" error, I almost have it changed before the site page completes loading. :D

 

Paul

 

PS. what are you using for an editor? Just curious.

Link to comment
Share on other sites

I use dreamweaver or notepad, it?s ok?

 

As long as the program you're using saves the correct charset and don't add extra code that messes things up, it shouldn't matter what program you use.

 

You should be able to set the charset in any good editor.

 

Be sure to save documents in the same charset as the one you specify in the meta tags.

You may also want to check to see if your server's sending documents in a default charset, and save your documents accordingly or change the default charset for the server.

 

In osCommerce, the meta tag charset is set in includes/languages/<yourLanguage>.php.

 

Eivind

Link to comment
Share on other sites

Just a note.

 

I am using EasyPopulate for the site. And when you upload using this nothing will change in the SEO cache file. So, for a quick answer, I just deleted the file in the cache directory. And it magically regenerated with the new product added. (thanks to Bobby's coding). But, I realized that we needed something a bit more automatic. So, I modd'ed the easypopulate.php file.

 

I added one line at the bottom of the file

 

 require('includes/reset_seo_cache.php');

 

Now the bottom of the file lookes like this.

 

// end of row insertion code
}

require('includes/reset_seo_cache.php');
require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

Seems to work.

 

Paul

Link to comment
Share on other sites

Fourbit,

 

Very nice! That will do it...can you post that over in the Easy Populate thread as well? I'm sure they'll appreciate it since it's a one line fix for immediate compatiblity.

 

Good job!

 

Bobby

Link to comment
Share on other sites

OK...here is the quick fix. 2 files need to be changed: application_top.php and product_listing.php.

 

Perfect! It looks great!

 

Now I'm off to try and make my Wishlist work with this. If I get that working, next stop will be to re-incorporate meta tags.

 

Thanks, Bobby!

 

-jared

Link to comment
Share on other sites

Jared,

 

Don't know much about the wishlist but the meta tags should work without modifications. This contribution is a transparent wrapper.

 

If you echo $_SERVER[php_SELF] it'll be either index.php or product_info.php. If you echo $_GET['products_id'] or $_GET['cPath'] it'll come up with the right values. Thus, it is a transparent wrapper and should not affect the metas.

 

If you run into issues let me know but I've installed it on 4 or 5 sites with Linda McGrath's Header Tag Controller without a hitch.

 

Bobby

Link to comment
Share on other sites

Problem is, I can't remember at the moment which meta tag contrib I added - - was simpler than Linda's from what I remember. But, it's my anniversary, and my wife is just about home from the store, so I suspect my time for osC is done until tomorrow. <grin>

 

-jared

Link to comment
Share on other sites

Passing thought: If you are using uploading to Froogle, then the current froogle upload code will use the "old" URLs.

 

Just a thought.

 

You had to know this was coming, Bobby - - everyone wants to use your code, and so wants all of everyone else's contribs to work with it. If we're not careful, you'll make programmers out of the hacks, and hacks out of the uninitiated. :D

 

-jared

Link to comment
Share on other sites

As with cName all the old URL's still work :)

 

So, if you have existing links from Froogle, other data feeds, or affiliates they will all still work. This is one of the reasons I went with a streamlined code...for compatibility.

 

To test this go to a product page and hover over the image (which will have the pid in the browser status bar). Just redo the URL old school style like /products_info.php?products_id=xx and it'll pull up the same page.

 

Bobby

Link to comment
Share on other sites

nope - - doesn't look like I can use the meta tag contrib I was using previously. It's one in an e-book I bought a while ago from Gary Burton, but it pulls the product description from the database using the product id code in the URL.

 

I'll have to go find one of the other ones. Pity. In its most basic form, it was just a few lines added to product_info.php. Super simple.

 

-jared

Link to comment
Share on other sites

hhmmm...whether you use the cName or Rewrite method it should still pass the products_id and cPath transparently.

 

I assume this is all happening in application_top so can you send me the file and let me take a look? It's probly just something that needs to me moved around a bit...I'm interested to see and fix it.

 

Bobby

Link to comment
Share on other sites

As with cName all the old URL's still work :)

 

So, if you have existing links from Froogle, other data feeds, or affiliates they will all still work.  This is one of the reasons I went with a streamlined code...for compatibility.

 

To test this go to a product page and hover over the image (which will have the pid in the browser status bar).  Just redo the URL old school style like /products_info.php?products_id=xx and it'll pull up the same page.

 

Bobby

 

True, true. I just wonder what Google thinks of having a bunch of very similar-looking/different-URL entries in their database that return the very same HTML data.

 

-jared

Link to comment
Share on other sites

hhmmm...whether you use the cName or Rewrite method it should still pass the products_id and cPath transparently.

 

I assume this is all happening in application_top so can you send me the file and let me take a look?  It's probly just something that needs to me moved around a bit...I'm interested to see  and fix it.

 

Bobby

 

It's actually happening in product_info.php. Since it's part of the book I bought from Gary, I'll ask him first before sharing it (since he asked that nicely in his book - - sure, he could have shared it on the forums, but it was a cheap book, and probably worth the time I saved just for searching the code and forums. I learned at lot, too.

 

Ah, yes. And it does work. Not sure why I was thinking it didn't.

 

-jared

Edited by jcall
Link to comment
Share on other sites

ooops...forgot to answer your second part of the post :)

 

My first guess would be that you did not perform the .htaccess file edit and hence do not have anything rewriting the URLs.  If you forgot to do that step it will give 404 errors as you describe.

 

Go back and verify that you did indeed make the changes...the code should look like this:

RewriteEngine On 
RewriteBase /
# or, RewriteBase /catalog/ depending on if it is root or folder install
RewriteRule ^(.*)-p-(.*).html$ product_info.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-c-(.*).html$ index.php?cPath=$2&%{QUERY_STRING}

 

Bobby

 

Bobby

I'm still getting 404 errors in rewrite mode. I have checked the .htaccess file, it reads as per the instructions.

 

The address bar reads http://ukgadgetsdirect.co.uk/remote-control-cars-c-36.html for my first cat and http://ukgadgetsdirect.co.uk/bmw-12v-2-cha...-blue-p-51.html for a product in it, but disply is a 404 error.

 

Paul

Regards

Paul

Link to comment
Share on other sites

Hi Bobby,

 

I believe I followed step by step instructions (very nicely done in html by the way!) I also altered the .htaccess (root where my shop is) uiploaded as instructed but I get the following errors when the shop displays. (admin seems OK) I went back and restored both my includes/application_top.php & includes/functions/html_output.php and it's back to norm but I would like your contrib. What did I do wrong?

Thanks, KJ

 

Parse error: parse error, unexpected '}' in /home/virtual/site37/fst/var/www/html/includes/functions/html_output.php on line 200

 

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/virtual/site37/fst/var/www/html/includes/functions/html_output.php:200) in /home/virtual/site37/fst/var/www/html/includes/functions/sessions.php on line 67

 

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/virtual/site37/fst/var/www/html/includes/functions/html_output.php:200) in /home/virtual/site37/fst/var/www/html/includes/functions/sessions.php on line 67

 

Warning: fopen(): SAFE MODE Restriction in effect. The script whose uid is 694 is not allowed to access / owned by uid 0 in /home/virtual/site37/fst/var/www/html/includes/seo_cache.php on line 199

 

Warning: fopen(/ultimate_seo_cacheseo_english.cache): failed to open stream: No such file or directory in /home/virtual/site37/fst/var/www/html/includes/seo_cache.php on line 199

 

Warning: fwrite(): supplied argument is not a valid stream resource in /home/virtual/site37/fst/var/www/html/includes/seo_cache.php on line 200

 

Warning: fclose(): supplied argument is not a valid stream resource in /home/virtual/site37/fst/var/www/html/includes/seo_cache.php on line 201

 

Warning: main(): Unable to access /ultimate_seo_cacheseo_english.cache in /home/virtual/site37/fst/var/www/html/includes/seo_cache.php on line 204

 

Warning: main(/ultimate_seo_cacheseo_english.cache): failed to open stream: No such file or directory in /home/virtual/site37/fst/var/www/html/includes/seo_cache.php on line 204

 

Warning: main(): Failed opening '/ultimate_seo_cacheseo_english.cache' for inclusion (include_path='.:/php/includes:/usr/share/php') in /home/virtual/site37/fst/var/www/html/includes/seo_cache.php on line 204

 

 

Fatal error: Call to undefined function: tep_image() in /home/virtual/site37/fst/var/www/html/includes/header.php on line 64

 

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

Link to comment
Share on other sites

Bobby

 

Server OS: Linux 2.4.21-4.0.1.ELsmp

HTTP Server: Apache

PHP Version: 4.3.9 (Zend: 1.3.0)

 

Does this help?

 

Paul

 

 

From one Paul to another. ;) HOWDY.

 

I am making an assumption here. But, it looks like your store is in the root directory. Is that correct or are you using another redirect somewhere?

 

Maybe if you post your .htaccess file, that would help.

 

Paul

Link to comment
Share on other sites

Forbit:

 

Parse error: parse error, unexpected '}' in /home/virtual/site37/fst/var/www/html/includes/functions/html_output.php on line 200

 

Start at line 200, check out that } it's probably left over from copy and pasting. If you clear this up then you might find some or all of the errors will dissapear.

 

Im fairly sure that the next two session_start(): errors will bite the dust. Backup what you have and play around.

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