Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Seach Engine Friendly URL Support


BlueYon

Recommended Posts

  • Replies 968
  • Created
  • Last Reply

Top Posters In This Topic

ok doing it now!

 

I just installed the new version and it works great. The drop down for manufacturers works great, the bread crumbs work, the nested categories works great. Also all my old links from the original osc indexed links work. My back button is missing, I will look into that, no biggie if I can't get that working. I really like the concept of this contribution. I used another one for about a year but wasn't totally happy with it. This is what I have been looking and waiting for. Thanks for everyones hard work, wish I was a coder.

Mair

Link to comment
Share on other sites

Hello,

 

2 problems:

 

1. There is no custom install for index.php. I copied everything marked with SEF from your index into mine and it gives me an error - basically a missing "}" somewhere.

 

2. Every link takes me back to the default front page.

 

 

Best regards,

Brett

Link to comment
Share on other sites

Found it....

 

index.php

 

under:

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);

 

insert:

//SEF BEGIN

}

//SEF END

 

 

 

However, every link still takes me to the default index.php page.

Edited by cornernote
Link to comment
Share on other sites

However, every link still takes me to the default index.php page.

 

Ok - it is because I run my shop from /catalog

 

application_top.php:

 

FIND:

$url = str_replace('?', '/', $url);

$url = str_replace('=', '/', $url);

$url = str_replace('&', '/', $url);

 

AFTER, INSERT:

$url = str_replace('catalog/', '', $url);

 

FIND:

if((trim($PHP_SELF, '/') == FILENAME_DEFAULT)and(sizeof($url_array) > 0)){

 

REPLACE WITH:

if((str_replace('catalog/', '', trim($PHP_SELF, '/')) == FILENAME_DEFAULT)and(sizeof($url_array) > 0)){

 

Seems to work, except the category does not get printed in the URL, only the product name.

 

 

Best regards,

Brett

Link to comment
Share on other sites

Also, the popup images do not work and I have lost some of my CSS.

 

I checked the base HTML tag and it's there so I'm not quite sure what is causing this.

 

This is beacuse it no longer uses product_info.php... everything goes through index.php. The changes I made to product_info.php had to be applied to the SEF additions to index.php.

Link to comment
Share on other sites

I just installed the new version and it works great.  The drop down for manufacturers works great, the bread crumbs work, the nested categories works great.  Also all my old links from the original osc indexed links work.  My back button is missing, I will look into that, no biggie if I can't get that working.  I really like the concept of this contribution.  I used another one for about a year but wasn't totally happy with it.  This is what I have been looking and waiting for.  Thanks for everyones hard work, wish I was a coder.

Mair

 

 

Now my back button works great. All is working great, no problems for me with anything.

 

I used this code for the back buttons:

 

<?php

$back = sizeof($navigation->path)-2;

if (isset($navigation->path[$back])) {

?>

<td class="main" align="center"><?php echo '<a href="' . tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>

<?php } else {?>

<td class="main" align="center"><a href="java script:history.go(-1)"><?php echo tep_image_button('button_back.gif', IMAGE_BUTTON_BACK); ?></a></td>

<?php

}

?>

 

 

Mair

Link to comment
Share on other sites

Now my back button works great.  All is working great, no problems for me with anything.

 

I used this code for the back buttons:

 

<?php

  $back = sizeof($navigation->path)-2;

  if (isset($navigation->path[$back])) {

?>

              <td class="main" align="center"><?php echo '<a href="' . tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>

<?php } else {?>

              <td class="main" align="center"><a href="java script:history.go(-1)"><?php echo tep_image_button('button_back.gif', IMAGE_BUTTON_BACK); ?></a></td>

<?php

  }

?>

Mair

 

 

Back button should work any way. Ithink oscommerce has a bug with thte contiune shopping button!

Link to comment
Share on other sites

Finally I made this MOD work on my website.

But still one problem, the popup image can't work.

The java script is just like this :

java script:popupWindow('http://mysite.com/popup_image.php/pID/31') .

BTW, I also installed Automatic_Thumbnail MOD to create small images on the page.

Could you pls. help?

Thanks :blush:

Link to comment
Share on other sites

I also tried MOD sef_link_transformer_0.8.0. It works and successfully converts all the pages to html. However, as I integrated phpBB forum with my OSC, it failed to change the link www.mysite.com/phpbb/index.php. The changed link is like this :www.mysite.com//phpbbindex.php :'(

Link to comment
Share on other sites

Finally I made this MOD work on my website.

But still one problem, the popup image can't work.

The java script is just like this :

java script:popupWindow('http://mysite.com/popup_image.php/pID/31') .

BTW, I also installed Automatic_Thumbnail MOD to create small images on the page.

Could you pls. help?

Thanks :blush:

 

 

Hello,

 

Copy the JS function "popupWindow" from product_info.php.

 

 

Best regards,

Brett

Link to comment
Share on other sites

2 more problems:

1. When I use "review" or "add to cart", there will be some error message in the bottom of the page saying "Error! Unable to determine the page link! ". However, "review" and "add to cart" functions do work.

2. I also installed HEARDER_TAG_CONTROLLER mod before I install this MOD. I found that the header tag for catogory worked fine , but the product page didn't work properly.

For example, I have a category named " Hardware products" and inside it a product named "HP printer". When I click the " Hardware products" page, the title is " Hardware products- mysite" . When I enter the product page, the title should be like this: " HP printer - mysite", but now ,it is still "Hardware products-mysite".

Pls. help :rolleyes:

Link to comment
Share on other sites

2 more problems:

1. When I use "review" or "add to cart", there will be some error message in the bottom of the page saying "Error!  Unable to determine the page link! ". However, "review" and "add to cart" functions do work.

2. I also installed HEARDER_TAG_CONTROLLER mod before I install this MOD. I found that the header tag for catogory worked fine , but the product page didn't work properly.

For example, I have a category named " Hardware products" and inside it a product named "HP printer". When I click the " Hardware products" page, the title is " Hardware products- mysite" . When I enter the product page, the title should be like this: " HP printer - mysite", but now ,it is still "Hardware products-mysite".

Pls. help :rolleyes:

 

I couldn't reproduce the first error..

for the second one:

 

in includes/header_tags.php find:

// INDEX.PHP
 case (strstr($_SERVER['PHP_SELF'],FILENAME_DEFAULT) or strstr($PHP_SELF,FILENAME_DEFAULT) ):
   $the_category_query = tep_db_query("select cd.categories_name from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");
   $the_category = tep_db_fetch_array($the_category_query);

   $the_manufacturers_query= tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
   $the_manufacturers = tep_db_fetch_array($the_manufacturers_query);

   if (HTDA_DEFAULT_ON=='1') {
     $the_desc= HEAD_DESC_TAG_DEFAULT . ' ' . HEAD_DESC_TAG_ALL;
   } else {
     $the_desc= HEAD_DESC_TAG_DEFAULT;
   }

   if (HTKA_DEFAULT_ON=='1') {
     $the_key_words= HEAD_KEY_TAG_ALL . ' ' . HEAD_KEY_TAG_DEFAULT;
   } else {
     $the_key_words= HEAD_KEY_TAG_DEFAULT;
   }

   if (HTTA_DEFAULT_ON=='1') {
     $the_title= HEAD_TITLE_TAG_DEFAULT . " " . $the_category['categories_name'] . $the_manufacturers['manufacturers_name'] . ' - ' . HEAD_TITLE_TAG_ALL;
   } else {
     $the_title= HEAD_TITLE_TAG_DEFAULT;
   }

   break;

 

and replace with:

// INDEX.PHP
 case (strstr($_SERVER['PHP_SELF'],FILENAME_DEFAULT) or strstr($PHP_SELF,FILENAME_DEFAULT) ):
  if(!$HTTP_GET_VARS['products_id']){
 $the_category_query = tep_db_query("select cd.categories_name from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");
 $the_category = tep_db_fetch_array($the_category_query);

 $the_manufacturers_query= tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
 $the_manufacturers = tep_db_fetch_array($the_manufacturers_query);

 if (HTDA_DEFAULT_ON=='1') {
	 $the_desc= HEAD_DESC_TAG_DEFAULT . ' ' . HEAD_DESC_TAG_ALL;
 } else {
	 $the_desc= HEAD_DESC_TAG_DEFAULT;
 }

 if (HTKA_DEFAULT_ON=='1') {
 $the_key_words= HEAD_KEY_TAG_ALL . ' ' . HEAD_KEY_TAG_DEFAULT;
 } else {
	 $the_key_words= HEAD_KEY_TAG_DEFAULT;
 }

 if (HTTA_DEFAULT_ON=='1') {
	 $the_title= HEAD_TITLE_TAG_DEFAULT . " " . $the_category['categories_name'] . $the_manufacturers['manufacturers_name'] . ' - ' . HEAD_TITLE_TAG_ALL;
 } else {
	 $the_title= HEAD_TITLE_TAG_DEFAULT;
 }
   break;
  }
  else{
  $the_product_info_query = tep_db_query("select pd.language_id, p.products_id, pd.products_name, pd.products_description, pd.products_head_title_tag, pd.products_head_keywords_tag, pd.products_head_desc_tag, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, 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);

 if (empty($the_product_info['products_head_desc_tag'])) {
	 $the_desc= HEAD_DESC_TAG_ALL;
 } else {
	 if ( HTDA_PRODUCT_INFO_ON=='1' ) {
   $the_desc= $the_product_info['products_head_desc_tag'] . ' ' . HEAD_DESC_TAG_ALL;
	 } else {
   $the_desc= $the_product_info['products_head_desc_tag'];
	 }
 }

 if (empty($the_product_info['products_head_keywords_tag'])) {
	 $the_key_words= HEAD_KEY_TAG_ALL;
 } else {
	 if ( HTKA_PRODUCT_INFO_ON=='1' ) {
   $the_key_words= $the_product_info['products_head_keywords_tag'] . ' ' . HEAD_KEY_TAG_ALL;
	 } else {
   $the_key_words= $the_product_info['products_head_keywords_tag'];
	 }
 }
 
 if (empty($the_product_info['products_head_title_tag'])) {
	 $the_title= HEAD_TITLE_TAG_ALL;
 } else {
	 if ( HTTA_PRODUCT_INFO_ON=='1' ) {
   $the_title= $the_product_info['products_head_title_tag'] . ' - ' . HEAD_TITLE_TAG_ALL;
	 } else {
   $the_title= $the_product_info['products_head_title_tag'];
	 }
 }

 break;

  }

 

should work now ;-)

Link to comment
Share on other sites

Problem?? I have been watching a search engine tonight and it is converting the capital letters in the url to lowercase. When the url is in lowercase it redirects back to the home page. So how should we deal with this. Is there a rewrite code to transform any capital letters to lowercase as lowercase would probably be better anyway. I hate to even think of changing over 3000 titles, yikes. Thanks alot.

Mair

Link to comment
Share on other sites

Problem?? I have been watching a search engine tonight and it is converting the capital letters in the url to lowercase.  When the url is in lowercase it redirects back to the home page.  So how should we deal with this.  Is there a rewrite code to transform any capital letters to lowercase as lowercase would probably be better anyway.  I hate to even think of changing over 3000 titles, yikes.  Thanks alot.

Mair

 

Hello,

 

That seems very strange because on Linux servers the filenames are all case sensitive. If your page is called Products.php then calling products.php will give a 404 (page not found) error.

 

Which search engine is it?

 

 

Best regards,

Brett

Link to comment
Share on other sites

I couldn't reproduce the first error..

for the second one:

 

in includes/header_tags.php find:

..

should work now ;-)

 

Yes, it should be caused by the merge of index.php and product_info.php. I'll try your method. Thanks :)

 

For the first error, it seems that the page can't find footer.php. I'll check it again. :rolleyes:

Link to comment
Share on other sites

Hello,

 

That seems very strange because on Linux servers the filenames are all case sensitive.  If your page is called Products.php then calling products.php will give a 404 (page not found) error.

 

Which search engine is it?

Best regards,

Brett

 

The search engine is Inktomi. It is converting the uppercase letters in the categories and product titles to lowercase. So if they list my urls like that they won't go to the pages. I am looking for a rewrite rule.

Mair

Link to comment
Share on other sites

I've solve the header tag problem using RikP' s method. :thumbsup:

 

For the "review" and "add to cart" problem , more info:

 

The converted URL is like this:

http://www.mysite.com/product_reviews.php/products_id/118

instead of :

http://www.mysite.com/product_reviews/products_id/118

 

The title will be :

Top ? Catalog ? Hardware products and accessories ? ? Reviews

There is an unexpected ">>" :rolleyes:

 

 

At the bottom of the page , it says:

Error!

Unable to determine the page link!

 

Seems that the page can't find footer.php because footer is not displayed.

 

:blush:

Link to comment
Share on other sites

I've solve the header tag problem using RikP' s method.  :thumbsup:

 

For the "review" and "add to cart" problem , more info:

 

The converted URL is like this:

http://www.mysite.com/product_reviews.php/products_id/118

instead of :

http://www.mysite.com/product_reviews/products_id/118

 

The title will be :

  Top ? Catalog ? Hardware products and accessories ? ? Reviews

There is an unexpected ">>" :rolleyes:

At the bottom of the page , it says:

Error!

Unable to determine the page link!

 

Seems that the page can't find footer.php because footer is not displayed.

 

:blush:

 

Hi,

 

for reviews the url isn't rewritten by this mod, so it should be

http://www.mysite.com/product_reviews.php/products_id/118

 

don't understand why you are having double >>

still can't reproduce your bug :(

 

second:

 

i think the lower-case bug can be solved quickly..

when i have time i will look into it :D

Link to comment
Share on other sites

The search engine is Inktomi.  It is converting the uppercase letters in the categories and product titles to lowercase.  So if they list my urls like that they won't go to the pages.  I am looking for a rewrite rule.

Mair

 

ok fixed it...

look in the contributions section for the update!

Link to comment
Share on other sites

Problem?? I have been watching a search engine tonight and it is converting the capital letters in the url to lowercase.  When the url is in lowercase it redirects back to the home page.  So how should we deal with this.  Is there a rewrite code to transform any capital letters to lowercase as lowercase would probably be better anyway.  I hate to even think of changing over 3000 titles, yikes.  Thanks alot.

Mair

 

I have checked this but it does not seem to be happening!

 

do site:www.yoursite.com

 

you should see the search enigine letters stay the same!

 

Google

 

http://www.google.co.uk/search?q=site:www....e&start=30&sa=N

 

Yahoo

http://search.yahoo.com/search?p=site%3Aww...ggle=1&ei=UTF-8

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