douglaswalker Posted May 25, 2019 Share Posted May 25, 2019 @Hotclutch the redirect does not work if the product is in the database and turned off or deleted from the database. I have tested all possibilities. it just appends the product_info part to the end of the url deeply annoying Quote Link to comment Share on other sites More sharing options...
douglaswalker Posted May 25, 2019 Share Posted May 25, 2019 1 hour ago, douglaswalker said: A similar issue is here https://www.oscommerce.com/forums/topic/408028-301-redirects-and-seo-urls/ to do with category redirects Quote Link to comment Share on other sites More sharing options...
Hotclutch Posted May 25, 2019 Share Posted May 25, 2019 does not make sense. Once you delete the product, there's nothing in the code that would cause that. Unless you have something else going on. Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted May 25, 2019 Share Posted May 25, 2019 Add the redirect above the redirects for this addon and let the code sort it out. redirect 301 /product-p-800.html https://www.site.com/product_info.php?products_id=900 Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
douglaswalker Posted May 26, 2019 Share Posted May 26, 2019 @Jack_mcs 11 hours ago, Jack_mcs said: Add the redirect above the redirects for this addon and let the code sort it out. redirect 301 /product-p-800.html https://www.site.com/product_info.php?products_id=900 I tried the above(with my site details) but it goes to a page not found.. i tried turning off your header redirect still goes to stock page not found.. reset seo cache still page not found.. It is ignoring the 301... weird Quote Link to comment Share on other sites More sharing options...
douglaswalker Posted May 26, 2019 Share Posted May 26, 2019 Please ignore the post above @Jack_mcs solution 12 hours ago, Jack_mcs said: Add the redirect above the redirects for this addon and let the code sort it out. redirect 301 /product-p-800.html https://www.site.com/product_info.php?products_id=900 is absolutely right. I made a mistake with the URL. Thanks all for your help Quote Link to comment Share on other sites More sharing options...
zpupster Posted May 27, 2019 Share Posted May 27, 2019 hello support, i am using frozen 2341CE, with php 7.1. trying to install oscom-ultimate-seo-urls-36rDo-CPS2y. in the instructions it states to find this in: STEP #4 - Edit admin/categories.php //// // Ultimate SEO URLs v2.2d // The HTML href link wrapper function function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) { global $seo_urls; if ( !is_object($seo_urls) ){ if ( !class_exists('SEO_URL') ){ include_once('includes/classes/seo.class.php'); } global $languages_id; $seo_urls = new SEO_URL($languages_id); } return $seo_urls->href_link($page, $parameters, $connection, $add_session_id); } and add after: // Ultimate SEO URLs v2.2d // If the action will affect the cache entries if ( preg_match("/(insert|update|setflag)/i", $action) ) include_once('includes/reset_seo_cache.php'); searching for pieces of the code or searching the whole site for wrapper function I can not find something resembling the code so where do i put the new suggested code??? Z Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted May 27, 2019 Share Posted May 27, 2019 1 hour ago, zpupster said: it states to find this in: STEP #4 - Edit admin/categories.php It looks like you mixed step 4 and 5. Please take another look at the instructions. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
zpupster Posted May 27, 2019 Share Posted May 27, 2019 thanks Jack, what i posted was how it appeared. I reloaded the instructions page and it is now corrected. TY again Z Quote Link to comment Share on other sites More sharing options...
douglaswalker Posted June 9, 2019 Share Posted June 9, 2019 (edited) Hi there I found a curious issue when this addon is used with a navbar drop down cart in the header. The urls of the products in the cart drop down look like this https://www.site.com.au/-p-700.html instead of https://www.site.com.au/name-of-product/-p-700.html The code to create the cart in the navbar is standard <?php $products = $cart->get_products(); foreach ($products as $k => $v) { echo '<li>' . sprintf(MODULE_NAVBAR_SHOPPING_CART_PRODUCT, $v['id'], $v['quantity'], $v['name']) . '</li>'; } ?> and the language file define('MODULE_NAVBAR_SHOPPING_CART_PRODUCT', '<a href="' . tep_href_link('product_info.php', 'products_id=%s') . '">%s x %s</a>'); Just wondered why this is? Edited June 10, 2019 by bonbec remove real link Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted June 9, 2019 Share Posted June 9, 2019 Try changing the $v['name'] to "test". If test shows up in the url, then the $v['name'] is not set. Also, to be clear, the url would not have the slash you show so it would be https://www.site.com.au/name-of-product-p-700.html . That was probably a typo but I thought I should mention it. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
douglaswalker Posted June 10, 2019 Share Posted June 10, 2019 9 hours ago, Jack_mcs said: Try changing the $v['name'] to "test". If test shows up in the url, then the $v['name'] is not set. Also, to be clear, the url would not have the slash you show so it would be https://www.site.com.au/name-of-product-p-700.html . That was probably a typo but I thought I should mention it. Hi there I did as suggested and the name disappeared from the drop down and was not replaced by the word test. Url was a typo but the link that currently shows is https://www.site.com.au/-p-700.html Quote Link to comment Share on other sites More sharing options...
douglaswalker Posted June 10, 2019 Share Posted June 10, 2019 The other question I have is over the years a few people have linked to the site incorrectly leaving a white space in the url which becomes %20 is there a way to use htaccess or any other method to strip out any whitespaces before any other redirects happen. The url in question is https://www.site.com/product_info?cPath=28&(spaceishere)products_id=1000 Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted June 10, 2019 Share Posted June 10, 2019 I'm not sure of the precedence order when a sprintf command is used for a function in a language file. I wouldn't code it that way. It might be that the link is being built before the text is added. If all else fails, I would re-code it so there aren't three things going on in one call. Other than that, the only other thing I can think of is if you are using Header Tags SEO and haven't enabled the option for it in this addon and/or not ran fill tags. For the url spaces, see this. The code would go before the rewrites for those of this addon. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
douglaswalker Posted June 10, 2019 Share Posted June 10, 2019 Thanks so much for this I re-coded the shopping cart header module using the code from the column box module so avoided sprintf public function getOutput() { GLOBAL $cart, $currencies, $PHP_SELF; $cart_contents_string = ''; if ($cart->count_contents() > 0) { $cart_contents_string = NULL; $products = $cart->get_products(); for ($i=0, $n=sizeof($products); $i<$n; $i++) { $cart_contents_string .= '<li>'; $cart_contents_string .= '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">'; $cart_contents_string .= $products[$i]['quantity'] . ' x '; $cart_contents_string .= $products[$i]['name']; $cart_contents_string .= '</a></li>'; } } and then called <?php echo $cart_contents_string; ?> in the template file will sort out the htaccess part you have offered when the site is a bit quieter Quote Link to comment Share on other sites More sharing options...
douglaswalker Posted June 10, 2019 Share Posted June 10, 2019 The htaccess bit I couldnt get to work. i placed it above all the other code. It goes to page not working. could it be this bit as i don't want to add just remove # replace spaces by - in between RewriteRule ^([^\s%20]*)(?:\s|%20)+(.*)$ $1-$2 [L,R] Quote Link to comment Share on other sites More sharing options...
douglaswalker Posted June 10, 2019 Share Posted June 10, 2019 The htaccecss file works for urls like https://www.site.com/name-of-product(accidentalspace)-p-1000.html but not https://www.site.com/product_info?cPath=28&(spaceishere)products_id=1000 I thought it should remove the incorrect space and then the program takes over and redirects to the properly formed url Quote Link to comment Share on other sites More sharing options...
♥BrockleyJohn Posted June 10, 2019 Share Posted June 10, 2019 3 hours ago, douglaswalker said: The htaccess bit I couldnt get to work. i placed it above all the other code. It goes to page not working. could it be this bit as i don't want to add just remove # replace spaces by - in between RewriteRule ^([^\s%20]*)(?:\s|%20)+(.*)$ $1-$2 [L,R] This replaces space with a hyphen. If you change $1-$2 to $1$2 it would simply strip the space. Either will work in the section of url that's ignored (before -p-). Stripping the space is likely what you need for the query string (your example) but around the p 1000 would need the hyphen Quote Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released. Looking for a payment or shipping module? Maybe I've already done it. Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x Link to comment Share on other sites More sharing options...
douglaswalker Posted June 10, 2019 Share Posted June 10, 2019 @BrockleyJohn not sure what i am doing wrong here. I will go through the steps again and write them here to see if anyone can spot the issue https://www.site.com.au/product_info.php?cPath=28& &(space here)products_id=71 is a link that google has picked up somewhere on the web. It has a space wrongly placed between cPath=28&(space here) products_id=71 This is creating the page to fail and try to redirect over and over. It ultimately needs to go to https://www.mysite.com.au/product-product--toy-p-71.html once it has passed through SEO urls program So I am trying to strip the space out of cPath=28&(space here) products_id=71 using htaccess RewriteRule ^([^\s%20]*)(?:\s|%20)+(.*)$ $1$2 [L,R] then send it on its way. However the htaccess is not working Quote Link to comment Share on other sites More sharing options...
♥BrockleyJohn Posted June 10, 2019 Share Posted June 10, 2019 @douglaswalker sorry Doug didn't think properly - you need to change the query string rather than the url RewriteCond %{QUERY_STRING} "^([^\s%20]*)(?:\s|%20)+(.*)$" RewriteRule ^ %{REQUEST_URI}?%1%2 [L,R] altoid 1 Quote Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released. Looking for a payment or shipping module? Maybe I've already done it. Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x Link to comment Share on other sites More sharing options...
douglaswalker Posted June 11, 2019 Share Posted June 11, 2019 22 hours ago, BrockleyJohn said: @douglaswalker sorry Doug didn't think properly - you need to change the query string rather than the url RewriteCond %{QUERY_STRING} "^([^\s%20]*)(?:\s|%20)+(.*)$" RewriteRule ^ %{REQUEST_URI}?%1%2 [L,R] Thank-you that did the trick Quote Link to comment Share on other sites More sharing options...
wflynnnn Posted June 29, 2019 Share Posted June 29, 2019 (edited) Need help when I hover over links I don't see the seo friendly urls but when I click them it works and goes there? When I create a sitemap it makes it with dynamic links? Using oscommerce 2.2 rc2 - can't upgrade too many mods installed over the years. Any idea where to look? Edited June 29, 2019 by wflynnnn Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted June 29, 2019 Share Posted June 29, 2019 17 minutes ago, wflynnnn said: Using oscommerce 2.2 rc2 I doubt one of the latest versions of this addon will work for you. Try installing 2.2d-13 or earlier. You'll lose improvements and security fixes but that's the trade-off when running such an old shop. altoid 1 Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
ammsimon Posted July 15, 2019 Share Posted July 15, 2019 Hello Thank you for excusing my english Oscommerce 2.3.4 / ultimate seo url 2.2d18 / php7 Rewriting Works very well, but I see the robots on the following urls /my-product-name-p-788.html?products_id=788 (for more products) For manufacturers too /my-manufacturer-name-m-32.html?manufacturers_id=32 Is it normal ? Can someone help me thank you so much Jack_mcs 1 Quote Osc 2.3.4 mts template Link to comment Share on other sites More sharing options...
Jack_mcs Posted July 16, 2019 Share Posted July 16, 2019 7 hours ago, ammsimon said: Rewriting Works very well, but I see the robots on the following urls I'm not clear as to what you mean by "robots" in this context. Does the actual url look like your example? The only time I've seen a url like that, that I can recall, was due to improperly coded links in the code. So do all of the url's look like that or just cert ones? And what happens if you turn this addon off? Will the links then work if clicked on? Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.