Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

SEO URLS did not work properly


Evinrude9.5

Recommended Posts

Hi Folks,

 

I have a problem with seo urls add-on.

 

I downloaded the latest version of Ultimately seo url and got it installed on my site(2.31). Very thankful to the add-on contribution! Every thing worked just fine other than one thing I was not quite happy: I wished to display the manufacturer name and product name together on my product_info page (like www.mysite.com/espson-workforce545-p-2593.html). So I added a function of getting manufacturer name and added it to the seo.class.php, the code is as follow:

 

//function begin

function get_manufacturer_name_from_product($pID)

 

{
$this->performance['NUMBER_QUERIES']++;
$sql = "SELECT m.manufacturers_name, m.manufacturers_id
FROM ".TABLE_MANUFACTURERS." m
LEFT OUTER JOIN ".TABLE_PRODUCTS." p ON m.manufacturers_id = p.manufacturers_id
WHERE p.products_id = '".(int)$pID."'
LIMIT 1";

$result = $this->DB->FetchArray( $this->DB->Query( $sql ) );
$manufacturers_id = $result['manufacturers_id'] ;
$manufacturers_name = $result['manufacturers_name'] ;

$mName = $this->not_null($result['manufacturers_name']) ? $result['manufacturers_name'] : $result['manufacturers_name'];
$mName = $this->strip($mName);

$this->cache['MANUFACTURERS'][$full_cPath] = $mName;
$this->performance['QUERIES']['MANUFACTURERS'][] = $sql;
$return = $mName;

return $return;
} # end function

//function end

 

And udpated the codes of --case 'products_id'-- part inside  function parse_parameters($page, $params, &$separator) as follows:

//begin

 switch(true){

                                                case ( $page == 'product_info.php' && !$this->is_attribute_string($p2[1]) ):
                                                        $url = $this->make_url($page, $this->get_manufacturer_name_from_product($p2[1])."-".$this->get_product_name($p2[1]), $p2[0], $p2[1], '.html');
                                                        break;
                                                case ( $page == 'product_reviews.php' ):
                                                        $url = $this->make_url($page, $this->get_manufacturer_name_from_product($p2[1])."-".$this->get_product_name($p2[1]), 'products_id_review', $p2[1], '.html');
                                                        break;
                                                case ( $page == 'product_reviews_info.php' ):                                                        
                                                        $url = $this->make_url($page, $this->get_manufacturer_name_from_product($p2[1])."-".$this->get_product_name($p2[1]), 'products_id_review_info', $p2[1], '.html');
                                                        break;
                                                default:
                                                        $container[$p2[0]] = $p2[1];
                                                        break;
                                        } # end switch
                                        break;
//end
 
The result was funny, there was no error. and the urls were working great with pr and pri pages, the review and review info page showed properly as ( www.mysite.com/espon-workforce545-pr-2593.html )and so on.
 
BUT, the problem was with the product_info page, the manufacturer name was not showing on the address bar after click on the previous product_info href, it still stayed on( www.mysite.com/workforce545-p-2593.html )
 
HOWEVER, before click on the product_info href, when I hovered on the link, on the status bar, the url showed properly as (www.mysite.com/espon-workforce545-p-2593.html) it just would not parse to the address bar after click on the link.
 
The use cache was set false. Since -pr- and -pri- all worked fine, I assume that there was no problem with the functions, But I just have no idea why it did not work with -p-. Pulling out my hairs 16 hours with no solution. 
 
Any idea be appreciated.
 
Thanks.
 
Evinrude9.5
Link to comment
Share on other sites

Here an example of my /catalog/.htaccess

<IfModule mod_rewrite.c>
  RewriteEngine On

  # RewriteBase instructions
  # Change RewriteBase dependent on how your shop is accessed as below.
  # http://www.mysite.com = RewriteBase /
  # http://www.mysite.com/catalog/ = RewriteBase /catalog/ 
  # http://www.mysite.com/catalog/shop/ = RewriteBase /catalog/shop/

  # Change RewriteBase using the instructions above  
  RewriteBase / 
  RewriteRule ^([a-z0-9/-]+)-p-([0-9]+).html$ product_info.php [NC,L,QSA]
  RewriteRule ^([a-z0-9/-]+)-c-([0-9_]+).html$ index.php [NC,L,QSA]
  RewriteRule ^([a-z0-9/-]+)-m-([0-9]+).html$ index.php [NC,L,QSA]
  RewriteRule ^([a-z0-9/-]+)-pi-([0-9]+).html$ popup_image.php [NC,L,QSA]
  RewriteRule ^([a-z0-9/-]+)-pr-([0-9]+).html$ product_reviews.php [NC,L,QSA]
  RewriteRule ^([a-z0-9/-]+)-pri-([0-9]+).html$ product_reviews_info.php [NC,L,QSA]
  # Articles contribution
  # RewriteRule ^([a-z0-9/-]+)-t-([0-9_]+).html$ articles.php [NC,L,QSA]
  # RewriteRule ^([a-z0-9/-]+)-au-([0-9]+).html$ articles.php [NC,L,QSA]
  # RewriteRule ^([a-z0-9/-]+)-a-([0-9]+).html$ article_info.php [NC,L,QSA]
  # Information pages
  # RewriteRule ^([a-z0-9/-]+)-i-([0-9]+).html$ information.php [NC,L,QSA]
  # Links contribution
  # RewriteRule ^([a-z0-9/-]+)-links-([0-9_]+).html$ links.php [NC,L,QSA]
  # Newsdesk contribution
  # RewriteRule ^([a-z0-9/-]+)-n-([0-9]+).html$ newsdesk_info.php [NC,L,QSA]
  # RewriteRule ^([a-z0-9/-]+)-nc-([0-9]+).html$ newsdesk_index.php [NC,L,QSA]
  # RewriteRule ^([a-z0-9/-]+)-nri-([0-9]+).html$ newsdesk_reviews_info.php [NC,L,QSA]
  # RewriteRule ^([a-z0-9/-]+)-nra-([0-9]+).html$ newsdesk_reviews_article.php [NC,L,QSA]
</IfModule>

May be this will help you.

 

What Seo you use? Its this? -> http://addons.oscommerce.com/info/9544/ ?

  • The clever one learn from everything and from everybody
  • The normal one learn from his experience
  • The silly one knows everything better

[socrates, 412 before Christ]

Computers help us with the problems we wouldn't have without them!
99.9% of the bugs sit in front of the computer!
My programmed add-ons: WDW EasyTabs 1.0.3, WDW Facebook Like 1.0.0

if(isset($this) || !isset($this)){ // that's the question...

 

Link to comment
Share on other sites

Here an example of my /catalog/.htaccess

<IfModule mod_rewrite.c>
  RewriteEngine On

  # RewriteBase instructions
  # Change RewriteBase dependent on how your shop is accessed as below.
  # http://www.mysite.com = RewriteBase /
  # http://www.mysite.com/catalog/ = RewriteBase /catalog/ 
  # http://www.mysite.com/catalog/shop/ = RewriteBase /catalog/shop/

  # Change RewriteBase using the instructions above  
  RewriteBase / 
  RewriteRule ^([a-z0-9/-]+)-p-([0-9]+).html$ product_info.php [NC,L,QSA]
  RewriteRule ^([a-z0-9/-]+)-c-([0-9_]+).html$ index.php [NC,L,QSA]
  RewriteRule ^([a-z0-9/-]+)-m-([0-9]+).html$ index.php [NC,L,QSA]
  RewriteRule ^([a-z0-9/-]+)-pi-([0-9]+).html$ popup_image.php [NC,L,QSA]
  RewriteRule ^([a-z0-9/-]+)-pr-([0-9]+).html$ product_reviews.php [NC,L,QSA]
  RewriteRule ^([a-z0-9/-]+)-pri-([0-9]+).html$ product_reviews_info.php [NC,L,QSA]
  # Articles contribution
  # RewriteRule ^([a-z0-9/-]+)-t-([0-9_]+).html$ articles.php [NC,L,QSA]
  # RewriteRule ^([a-z0-9/-]+)-au-([0-9]+).html$ articles.php [NC,L,QSA]
  # RewriteRule ^([a-z0-9/-]+)-a-([0-9]+).html$ article_info.php [NC,L,QSA]
  # Information pages
  # RewriteRule ^([a-z0-9/-]+)-i-([0-9]+).html$ information.php [NC,L,QSA]
  # Links contribution
  # RewriteRule ^([a-z0-9/-]+)-links-([0-9_]+).html$ links.php [NC,L,QSA]
  # Newsdesk contribution
  # RewriteRule ^([a-z0-9/-]+)-n-([0-9]+).html$ newsdesk_info.php [NC,L,QSA]
  # RewriteRule ^([a-z0-9/-]+)-nc-([0-9]+).html$ newsdesk_index.php [NC,L,QSA]
  # RewriteRule ^([a-z0-9/-]+)-nri-([0-9]+).html$ newsdesk_reviews_info.php [NC,L,QSA]
  # RewriteRule ^([a-z0-9/-]+)-nra-([0-9]+).html$ newsdesk_reviews_article.php [NC,L,QSA]
</IfModule>

May be this will help you.

 

What Seo you use? Its this? -> http://addons.oscommerce.com/info/9544/ ?

Thanks mcmannehan, the seo url I used was older than this one, I think it was Oct 2016 version, forgot the where the link is.  I will study your .htaccess and post back if any change. thanks again.

Link to comment
Share on other sites

Hi All again,

 

Some additional Information:

 

my product_info page contains 5 social media link: tell_a_friend.php, facebook, twitter,g+,pinterest (I built my social share links on my own years ago). All these links can parse the correct expected SEF product_info URL (which contains the manufacturer name and product name as I expected, like( www.mysite.com/epson-workforce545-p-2593.html) to the destination sites (facebook, pinterest, twitter, g+) by one click, and the product_info link, image, manufacturer name, product name, product_info page meta description will show on the media site immediately.

 

Every single link on my site pointed to the specified product_info page will show the expected SEF URL with manufacturer name and product name exactly correct on the STATUS BAR of ALL TYPES of browsers (www.mysite.com/epson-workforce545-p-2593.html). BUT AFTER click on the link and open the product_info page, The manufacturer name was GONE on the address bar of the browser, become www.mysite.com/workforce545-p-2593.html. And also, when generating sitemap, all product_info pages do NOT have manufacturer names, not surprised.

 

The review and review info pages, and some other add-on pages using 'products_id' ALL WORK perfectly showing the manufacturer name. ONLY problem, also the most important page-product_info- page itself does not work as expected.

 

The version of Ultimate Seo Urls I am using is: Ultimate_SEO_URLSv22d_15. 

 

Please kindly support, any idea will be appreciated.

 

Thanks.

Link to comment
Share on other sites

Here an example of my /catalog/.htaccess

<IfModule mod_rewrite.c>
  RewriteEngine On

  # RewriteBase instructions
  # Change RewriteBase dependent on how your shop is accessed as below.
  # http://www.mysite.com = RewriteBase /
  # http://www.mysite.com/catalog/ = RewriteBase /catalog/ 
  # http://www.mysite.com/catalog/shop/ = RewriteBase /catalog/shop/

  # Change RewriteBase using the instructions above  
  RewriteBase / 
  RewriteRule ^([a-z0-9/-]+)-p-([0-9]+).html$ product_info.php [NC,L,QSA]
  RewriteRule ^([a-z0-9/-]+)-c-([0-9_]+).html$ index.php [NC,L,QSA]
  RewriteRule ^([a-z0-9/-]+)-m-([0-9]+).html$ index.php [NC,L,QSA]
  RewriteRule ^([a-z0-9/-]+)-pi-([0-9]+).html$ popup_image.php [NC,L,QSA]
  RewriteRule ^([a-z0-9/-]+)-pr-([0-9]+).html$ product_reviews.php [NC,L,QSA]
  RewriteRule ^([a-z0-9/-]+)-pri-([0-9]+).html$ product_reviews_info.php [NC,L,QSA]
  # Articles contribution
  # RewriteRule ^([a-z0-9/-]+)-t-([0-9_]+).html$ articles.php [NC,L,QSA]
  # RewriteRule ^([a-z0-9/-]+)-au-([0-9]+).html$ articles.php [NC,L,QSA]
  # RewriteRule ^([a-z0-9/-]+)-a-([0-9]+).html$ article_info.php [NC,L,QSA]
  # Information pages
  # RewriteRule ^([a-z0-9/-]+)-i-([0-9]+).html$ information.php [NC,L,QSA]
  # Links contribution
  # RewriteRule ^([a-z0-9/-]+)-links-([0-9_]+).html$ links.php [NC,L,QSA]
  # Newsdesk contribution
  # RewriteRule ^([a-z0-9/-]+)-n-([0-9]+).html$ newsdesk_info.php [NC,L,QSA]
  # RewriteRule ^([a-z0-9/-]+)-nc-([0-9]+).html$ newsdesk_index.php [NC,L,QSA]
  # RewriteRule ^([a-z0-9/-]+)-nri-([0-9]+).html$ newsdesk_reviews_info.php [NC,L,QSA]
  # RewriteRule ^([a-z0-9/-]+)-nra-([0-9]+).html$ newsdesk_reviews_article.php [NC,L,QSA]
</IfModule>

May be this will help you.

 

What Seo you use? Its this? -> http://addons.oscommerce.com/info/9544/ ?

Hi again, I do not think it is the problem of .htaccess setting, because all other things are working perfectly, like categories name and parents. thanks anyway.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...