Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Ultimate SEO URLs - by Chemo


Guest

Recommended Posts

Hi everyone,

 

Forgive my bumping my Rewrite issue from last week, which follows this message. It seems like it may have been lost in the shuffle, I'm afraid. Bobby - sorry to hear that you were sick last week. :(

 

This is the whole "Rewrite mode not working with 404 errors" issue. I did try all sorts of different configurations in the .htaccess, for copies of .htaccess in the root directory and the catalog directory (/Thoomp/catalog).

 

I'm wondering at this point if I need to change something in my http.conf file, although supposedly

the rewrite_module in Apache is already activated (mod_rewrite.c).

 

Thoughts? Thanks again in advance! :)

 

- Seth <>

 

http://www.gameoeuvre.com

Link to comment
Share on other sites

  • Replies 1.9k
  • Created
  • Last Reply

Top Posters In This Topic

I'm not familiar with that contribution so can't be of any help...sorry.

The Ultimate SEO URLs contribution is nothing more than an URL wrapper...so if you pages don't have meta tags then none will be picked up.  If you have a Header Tag Controller installed it will function correctly.  I have this installed on more client sites than I can count and all of their installations work correctly with header tags controller.

 

Bobby

 

 

My page(s) do have meta tags. I am using PHP to generate dynamic meta tags and I would assume once the page is loaded as an HTML file that it is cached somewhere on the server so that when the HTML file is called, it references those generated tags. Below is the code and it does work perfectly when loading PHP pages. I am using VSE Be Found Pro to run SE optimization, reports, and tracking.

 

 

CODE FOR DYNAMIC META TAGS ON PRODUCT_INFO.PHP

<!-- begin dynamic meta tags query -->

<?php

$the_product_info_query = tep_db_query("select pd.language_id, p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_price_retail, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'" . " and pd.language_id ='" .  (int)$languages_id . "'"); 

   $the_product_info = tep_db_fetch_array($the_product_info_query);

$the_product_name = strip_tags ($the_product_info['products_name'], "");

$the_product_description = strip_tags ($the_product_info['products_description'], "");

$the_product_model = strip_tags ($the_product_info['products_model'], "");

?>

<?php

$the_manufacturer_query = tep_db_query("select m.manufacturers_id, m.manufacturers_name from " . TABLE_MANUFACTURERS . " m left join " . TABLE_MANUFACTURERS_INFO . " mi on (m.manufacturers_id = mi.manufacturers_id and mi.languages_id = '" . (int)$languages_id . "'), " . TABLE_PRODUCTS . " p  where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.manufacturers_id = m.manufacturers_id"); 

$the_manufacturers = tep_db_fetch_array($the_manufacturer_query);

?>

<!-- end dynamic meta tags query -->

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<?php
//begin dynamic meta tags query -->
?>

<title><?php echo TITLE ?> : <?php echo $the_product_name; ?></title>

<meta name="keywords" content="<?php echo TITLE ?>, <?php echo $the_product_name; ?>, <?php echo $the_product_model; ?>, <?php echo $the_manufacturers['manufacturers_name']; ?>">

<meta name="description" content="<?php echo $the_product_description . "," . $the_product_name; ?>">

<?php
//end dynamic meta tags query -->
?>

Link to comment
Share on other sites

Aaron,

 

I may be missing something, but just off hand I don't see wher you are defining the 'TITLE'.

 

The first time it's used is here.

<title><?php echo TITLE ?> : <?php echo $the_product_name; ?></title>

 

Paul

 

My page(s) do have meta tags. I am using PHP to generate dynamic meta tags and I would assume once the page is loaded as an HTML file that it is cached somewhere on the server so that when the HTML file is called, it references those generated tags. Below is the code and it does work perfectly when loading PHP pages. I am using VSE Be Found Pro to run SE optimization, reports, and tracking.

CODE FOR DYNAMIC META TAGS ON PRODUCT_INFO.PHP

<!-- begin dynamic meta tags query -->

<?php

$the_product_info_query = tep_db_query("select pd.language_id, p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_price_retail, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'" . " and pd.language_id ='" .  (int)$languages_id . "'"); 

   $the_product_info = tep_db_fetch_array($the_product_info_query);

$the_product_name = strip_tags ($the_product_info['products_name'], "");

$the_product_description = strip_tags ($the_product_info['products_description'], "");

$the_product_model = strip_tags ($the_product_info['products_model'], "");

?>

<?php

$the_manufacturer_query = tep_db_query("select m.manufacturers_id, m.manufacturers_name from " . TABLE_MANUFACTURERS . " m left join " . TABLE_MANUFACTURERS_INFO . " mi on (m.manufacturers_id = mi.manufacturers_id and mi.languages_id = '" . (int)$languages_id . "'), " . TABLE_PRODUCTS . " p  where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.manufacturers_id = m.manufacturers_id"); 

$the_manufacturers = tep_db_fetch_array($the_manufacturer_query);

?>

<!-- end dynamic meta tags query -->

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<?php
//begin dynamic meta tags query -->
?>

<title><?php echo TITLE ?> : <?php echo $the_product_name; ?></title>

<meta name="keywords" content="<?php echo TITLE ?>, <?php echo $the_product_name; ?>, <?php echo $the_product_model; ?>, <?php echo $the_manufacturers['manufacturers_name']; ?>">

<meta name="description" content="<?php echo $the_product_description . "," . $the_product_name; ?>">

<?php
//end dynamic meta tags query -->
?>

Link to comment
Share on other sites

Aaron,

 

I may be missing something, but just off hand I don't see wher you are defining the 'TITLE'.

 

The first time it's used is here.

<title><?php echo TITLE ?> : <?php echo $the_product_name; ?></title>

 

Paul

 

 

Look more closely.

 

The <?php echo TITLE; ?> is generated in the english.php language file.

 

<?php echo $the_product_name; ?> is defined in the SQL query I posted.

 

The title comes out loking like this, for example:

MySite.com : Product Name

 

Let me know if I missed something, but it is working and has been for months. I would think the cahcing of the PHP to HTML would catch all that info.

Link to comment
Share on other sites

Look more closely.

 

The <?php echo TITLE; ?> is generated in the english.php language file.

 

<?php echo $the_product_name; ?> is defined in the SQL query I posted.

 

The title comes out loking like this, for example:

MySite.com : Product Name

 

Let me know if I missed something, but it is working and has been for months. I would think the cahcing of the PHP to HTML would catch all that info.

 

:D

 

I did look closer. And I don't see that you posted your english.php file. So, as I said I don't see where you are defining that 'TITLE'. I assumed that you were going dynamic with the db sql and were trying to use that as part of your 'TITLE'. But, no go.

 

I really think that this may have nothing to do with this contrib. So, it should probably be moved to a different thread or we can go PM? Just my thoughts.

 

Also, it may be helpful for us to see the actual site in question? ;)

 

Paul

Link to comment
Share on other sites

Bobby,

 

Many thanks for the fast reply! I have read all your related threads to cookies & domains. Still when I did it my website was messed up after modifying catalog/includes/configure.php

 

I would like to remember you that your contributions works fully! The problem is due to me & my website which is forcing the use of cookies (or else cName & Rewrite html won't work)

 

This is my configuration. Please let me know if I am missing something. Why is this common 'cookie-matter' taking me up to 2 days now?

 

I will be grateful if you could deliver me from this problem.

 

SEO URLs

-Enable SEO URLs? <===> Value= true

-Choose URL Type <===> Value=Rewrite

-Filter Short Words <===> Value=0

-Reset SEO URLs Cache<===> False

 

Sessions

-Sessions Directory <===> /tmp

-Force Cookie Use <===> True

Check SSL Session ID <===> False

Check User Agent <===> False

Check IP Address <===> True

Prevent Spider Sessions <===> True

Recreate Session <===> False

 

Cache

Cache <===> Use Cache <===> Value= False

Cache <===> Cache Directory <===> Value= /tmp/

Link to comment
Share on other sites

Thanks for your reply Chemo!

 

I'm gonna work on it and post the fix if I find it!!!

 

Thanks so much for your contribution and you availability.  :thumbsup:

 

Best regards.

 

Thanks to Kai the author of buy_two_module I am now able to use the two contributions together. One have to desactivate the name matching feature from the admin panel.

OSC2.2

Link to comment
Share on other sites

Thanks for all the help Chemo!

 

Don't bother replying my last question about cookies. I had exactly the same problem as the guy from oasefilter.de

I forgot to turn cache to false.

 

Great Contribution! All works extremely fine!

Link to comment
Share on other sites

:D

 

I did look closer. And I don't see that you posted your english.php file. So, as I said I don't see where you are defining that 'TITLE'. I assumed that you were going dynamic with the db sql and were trying to use that as part of your 'TITLE'. But, no go.

 

I really think that this may have nothing to do with this contrib. So, it should probably be moved to a different thread or we can go PM? Just my thoughts.

 

Also, it may be helpful for us to see the actual site in question? ;)

 

Paul

 

 

Thanks for the quick reply - I am banging my head on why engines/software do not seem to pick up the title and meta tags. The title for all pages is defined in your english.php file so that has not changed. I was assuming that the way this contribution worked is that when a product page is called, it caches a temporary HTML file that it can call on (rather than PHP) until admin changes something relating to that product. Then it would need to cache a new file. Correct? :huh:

 

Browsers have never had a problem processing the metas or titles of site pages before, and that part of it still works now. I was under the impression that once a product PHP page is "cached" to HTML, that you could call on that HTML file and all the metas, text, title, etc. would be pre-stored and easily readable in HTML format. Unfortunately that doesn't seem to work (at least for me).

 

The site is http://www.coolhotstuff.com and a specific product URL you can reference is:

http://coolhotstuff.com/store/chase-authen...cket-p-165.html

 

I would be interested to see how your search engine software recognizes the page. Since we do everything on Apple :thumbsup: , we do not have a plethora of SE software to choose from.

 

Thanks,

Aaron

Link to comment
Share on other sites

Thanks for the quick reply - I am banging my head on why engines/software do not seem to pick up the title and meta tags. The title for all pages is defined in your english.php file so that has not changed. I was assuming that the way this contribution worked is that when a product page is called, it caches a temporary HTML file that it can call on (rather than PHP) until admin changes something relating to that product. Then it would need to cache a new file. Correct?  :huh:

 

Ummm. No, this contrib doesn't cache any files. All it does is put your cat/product in a data table that can then be used to generate the corrected url's . Then the redirects in the .htaccess take that new url when it's used and reconfigure it along with some other codeing into a url that OSC recognizes.

 

So, none of the titles or metas are used. Your program code in index, phpinfo etc are still the ones that control the dynamic code. (I think) :D

 

Browsers have never had a problem processing the metas or titles of site pages before, and that part of it still works now. I was under the impression that once a product PHP page is "cached" to HTML, that you could call on that HTML file and all the metas, text, title, etc. would be pre-stored and easily readable in HTML format. Unfortunately that doesn't seem to work (at least for me).

 

The site is http://www.coolhotstuff.com and a specific product URL you can reference is:

http://coolhotstuff.com/store/chase-authen...cket-p-165.html

 

I would be interested to see how your search engine software recognizes the page. Since we do everything on Apple  :thumbsup: , we do not have a plethora of SE software to choose from.

 

Thanks,

Aaron

 

BTW, looks like the title and meta tags are doing fine. I just went to your site ( http://coolhotstuff.com/store/chase-authen...cket-p-165.html ). And this is the code at the top of the page.

<head>

<title>CoolHotStuff.com : Get it all here! : Chase Authentics Jeff Gordon Uniform Jacket</title>

<meta name="keywords" content="CoolHotStuff.com : Get it all here!, Chase Authentics Jeff Gordon Uniform Jacket, cuj24, Chase">

<meta name="description" content="Chase Authentic Nascar Jackets are the best on the market and highest quality Driver Jacket available !!!

These jackets boldly and proudly displays the driver and all team graphics and colors on the sleeves, across the chest and back as well !!!

Wearing these high quality jackets will surely get you noticed as you display who your favorite driver and racing team are !!

Chase Jackets Are The Official Trackside Jackets !!!,Chase Authentics Jeff Gordon Uniform Jacket">

 

Not knowing what it should look like, it looks good to me. :D

 

Paul

Link to comment
Share on other sites

Hi Aaron,

 

Can you tell me what you are using for the lookup software etc? This is very interesting.

 

Thanks,

Paul

 

PS. Or anyone else for that matter. What are you using for search engine emulation? To see what the search engines will see.

You can use my search engine useragent simulator located here: Chemo's osC Search Engine Spider - Beta. I coded it to put to rest the issues of whether or not the contribution was causing osCsid's to be cached with Google. It does not cause the osCsid's to be cached but is also nice to get some other info about your page.

 

Hi everyone,

 

Forgive my bumping my Rewrite issue from last week, which follows this message.  It seems like it may have been lost in the shuffle, I'm afraid.  Bobby - sorry to hear that you were sick last week.  :(

 

This is the whole "Rewrite mode not working with 404 errors" issue.  I did try all sorts of different configurations in the .htaccess, for copies of .htaccess in the root directory and the catalog directory (/Thoomp/catalog).

 

I'm wondering at this point if I need to change something in my http.conf file, although supposedly

the rewrite_module in Apache is already activated (mod_rewrite.c).

 

Thoughts?  Thanks again in advance!  :)

 

- Seth <>

 

http://www.gameoeuvre.com

You should not have any entries in the root level .htaccess file other than a possible redirect. To be honest, I would not use them in the root file and instead would use a PHP based header redirect (with 301 header of course).

 

Thanks for the quick reply - I am banging my head on why engines/software do not seem to pick up the title and meta tags. The title for all pages is defined in your english.php file so that has not changed. I was assuming that the way this contribution worked is that when a product page is called, it caches a temporary HTML file that it can call on (rather than PHP) until admin changes something relating to that product. Then it would need to cache a new file. Correct?  :huh:

 

Browsers have never had a problem processing the metas or titles of site pages before, and that part of it still works now. I was under the impression that once a product PHP page is "cached" to HTML, that you could call on that HTML file and all the metas, text, title, etc. would be pre-stored and easily readable in HTML format. Unfortunately that doesn't seem to work (at least for me).

 

The site is http://www.coolhotstuff.com and a specific product URL you can reference is:

http://coolhotstuff.com/store/chase-authen...cket-p-165.html

 

I would be interested to see how your search engine software recognizes the page. Since we do everything on Apple  :thumbsup: , we do not have a plethora of SE software to choose from.

 

Thanks,

Aaron

There is something awry with your site...I checked it with my browser and the tags are coming across just fine. However, when I check it with my spider simulator it does not pick up content NOR tags. Do you have anything else installed that may be conflicting?

 

Bobby

Link to comment
Share on other sites

Help!

 

I've done everything twice, meticulously, and my site's gone down :( . (That's not an accusation....I should have backed up :blush: )

 

To begin with, I've discovered the flavour of osC installed by my ISP sticks "oscommerce_" in front of every table name but I think I've managed to find all the entries that needed changing...well, certainly enough to get me through the install-seo.php setup page.

 

Now my site displays:

 

"Fatal error: Cannot redeclare implode_assoc() (previously declared in my shop/catalog/includes/functions/html_output.php:13) in my shop/catalog/includes/functions/html_output.php on line 36"

 

Any ideas?

Link to comment
Share on other sites

You have two functions in there that are duplicates of each other. Open includes/functions/html_output.php and remove one of the implode_assoc() functions.

 

Bobby

Link to comment
Share on other sites

You have two functions in there that are duplicates of each other.  Open includes/functions/html_output.php and remove one of the implode_assoc() functions.

 

Bobby

 

 

Great....thanks for the lightning response :D

 

I cut and paste that code from the help file....I've now deleted lines 13-35 and that error has stopped but now I'm getting:

 

"1146 - Table myDB.cache' doesn't exist

 

DELETE FROM cache WHERE cache_expires <= '2005-02-07 09:21:06'

 

[TEP STOP]

 

 

Last question....promise! If I can't sort it this time, I'll start with the original files again.

Link to comment
Share on other sites

Hi again, Bobby -

 

You said the following:

 

>> You should not have any entries in the root level .htaccess file other than a possible redirect.

>> To be honest, I would not use them in the root file and instead would use a PHP based

>> header redirect (with 301 header of course).

 

The only .htaccess file right now at all that's there, is in /Thoomp/catalog - I also tried placing an .htaccess file in root, but with no success.

 

The redirect that I probably mentioned is just an "index.html' page, which has a javascript redirect to: /Thoomp/catalog/index.php - Nothing fancy in the least bit.

 

PHP based header redirect? Scratching my head here, and I'll have to look it up. Do I need one to get this to work?

 

I checked httpd.conf of the server, and it seems that the rewrite engine module is set to "on."

 

Still confused and without out luck. Thanks, Bobby!

 

- Seth <>

Link to comment
Share on other sites

You can use my search engine useragent simulator located here: Chemo's osC Search Engine Spider - Beta.  I coded it to put to rest the issues of whether or not the contribution was causing osCsid's to be cached with Google.  It does not cause the osCsid's to be cached but is also nice to get some other info about your page.

You should not have any entries in the root level .htaccess file other than a possible redirect.  To be honest, I would not use them in the root file and instead would use a PHP based header redirect (with 301 header of course).

There is something awry with your site...I checked it with my browser and the tags are coming across just fine.  However, when I check it with my spider simulator it does not pick up content NOR tags.  Do you have anything else installed that may be conflicting?

 

Bobby

 

 

I would have to agree with Bobby. When I view the source of you site I see the meta tags but when I run it through a spider sim nothing... I know it is not the SEO contribution as any other site I check using it is ok.

 

Not sure what it is... but you might try using a different system for meta tags...

 

I have a simple one (link below) that seems to work fine if that helps...

 

Might want to looka the punctuation - migh be causing some problem???

osC Contributions I have published.

 

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

Link to comment
Share on other sites

Not knowing what it should look like, it looks good to me. :D

 

Paul

 

 

Thanks Paul,

 

Yes, it does load correctly, but so do the PHP files. What I am worried about are indexing robots and SEO software. They seem to not be picking up the metas and title. Does anyone here have SEO software they can use to verify this? It is possible it could just be our software, but I doubt it. Thanks again!

 

PS - When I use Chemo's Search Engine Spider Tool it shows no META info for the HTML url:

http://www.coolhotstuff.com/store/chase-au...cket-p-165.html

 

;)

-Aaron

Edited by royalfunk
Link to comment
Share on other sites

Great....thanks for the lightning response :D

 

I cut and paste that code from the help file....I've now deleted lines 13-35 and that error has stopped but now I'm getting:

 

"1146 - Table myDB.cache' doesn't exist

 

DELETE FROM cache WHERE cache_expires <= '2005-02-07 09:21:06'

 

[TEP STOP]

Last question....promise! If I can't sort it this time, I'll start with the original files again.

You need to run the install-cache.php file as per the instructions (STEP #2).

 

If you have installed the code in application_top.php already then comment them out so you can run the installer. Once you run the install script then go back to application_top.php and uncomment the code.

 

Hi again, Bobby -

 

You said the following:

 

>> You should not have any entries in the root level .htaccess file other than a possible redirect.

>> To be honest, I would not use them in the root file and instead would use a PHP based

>> header redirect (with 301 header of course).

 

The only .htaccess file right now at all that's there, is in /Thoomp/catalog - I also tried placing an .htaccess file in root, but with no success.

 

The redirect that I probably mentioned is just an "index.html' page, which has a javascript redirect to:  /Thoomp/catalog/index.php  - Nothing fancy in the least bit.

 

PHP based header redirect?  Scratching my head here, and I'll have to look it up.  Do I need one to get this to work?

 

I checked httpd.conf of the server, and it seems that the rewrite engine module is set to "on."

 

Still confused and without out luck.  Thanks, Bobby!

 

- Seth <>

Seth, your site is apparently not the typical install. I'm afraid I cannot help you anymore without actually getting in there and changing code myself (after debugging it).

 

Thanks Paul,

 

Yes, it does load correctly, but so do the PHP files. What I am worried about are indexing robots and SEO software. They seem to not be picking up the metas and title. Does anyone here have SEO software they can use to verify this? It is possible it could just be our software, but I doubt it. Thanks again!

 

PS - When I use Chemo's Search Engine Spider Tool it shows no META info for the HTML url:

http://www.coolhotstuff.com/store/chase-au...cket-p-165.html

 

;)

-Aaron

Could it possible be that you have line breaks in your meta tags? I tried a quick experiement with one of my sites and made it two lines (using \n) and it did not show that particular meta tag.

 

Try removing the line breaks.

 

Bobby

Link to comment
Share on other sites

Hello Bobby,

 

You are using an MS1 release. There is no doubt about it. I am 100% sure.

 

In MS1 there was no function that you had to imort. Secondly, you're having a DIR_WS_HTTP_CATALOG problem which was introduced in MS2 andhas a small code snippet in application top to handle it in MS2.

 

In my application_top.php I have:

 

// define the project version
 define('PROJECT_VERSION', 'osCommerce 2.2-MS2-CVS');

 

Third, MS2 uses index.php and ONLY MS1 used default.php

 

I had changed that myself.

 

Tommy :(

Link to comment
Share on other sites

OK...you are using an MS2-CVS release which is just above MS1. It is not the same code and the same steps cannot be used to install it.

 

Since MS2-CVS changed from day to day there is no way to tell you which snapshot you are using. The only way to get this installed is look at each step and merge the changes with your existing code. It can be done...I've installed it on several MS1 stores successfully.

 

Bobby

Link to comment
Share on other sites

You need to run the install-cache.php file as per the instructions (STEP #2).

 

If you have installed the code in application_top.php already then comment them out so you can run the installer.  Once you run the install script then go back to application_top.php and uncomment the code.

 

Thanks again...I thought that was going to be the last question... I'm too close to give up now :lol:

 

Seems like I've missed a table name somewhere:

 

1146 - Table 'myDB.products' doesn't exist

 

select p.products_id, pd.products_name from products p left join products_description pd on p.products_id=pd.products_id and pd.language_id='1' where p.products_status='1'

 

[TEP STOP]

Link to comment
Share on other sites

That is a core table...you need to restore your database backup and try again.

 

Bobby

 

Bobby,

 

On my version of osC, every table name has the prefix "oscommerce_". I had to change some of install-seo.php to get round that. Is it possible that this is happening again? If I restore application_top.php, the site works again, is there something I could have missed in there?

 

Cheers,

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