Jump to content

douglaswalker

Members
  • Content count

    430
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by douglaswalker

  1. douglaswalker

    [CONTRIBUTION] Ultimate SEO URLs v2.1 - by Chemo

    Thank-you that did the trick
  2. douglaswalker

    [CONTRIBUTION] Ultimate SEO URLs v2.1 - by Chemo

    @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
  3. douglaswalker

    [CONTRIBUTION] Ultimate SEO URLs v2.1 - by Chemo

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

    [CONTRIBUTION] Ultimate SEO URLs v2.1 - by Chemo

    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]
  5. douglaswalker

    [CONTRIBUTION] Ultimate SEO URLs v2.1 - by Chemo

    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'] . '&nbsp;x&nbsp;'; $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
  6. douglaswalker

    [CONTRIBUTION] Ultimate SEO URLs v2.1 - by Chemo

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

    [CONTRIBUTION] Ultimate SEO URLs v2.1 - by Chemo

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

    [CONTRIBUTION] Ultimate SEO URLs v2.1 - by Chemo

    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?
  9. douglaswalker

    [Addon] Modular Navigation Bar (Bootstrap)

    I got around the checking product numbers by creating an on / off in the categories listing using this addon. https://forums.oscommerce.com/topic/318434-contribution-hide-categories-products/?page=1 It means I have to manually turn the category on and off but that is ok Then all I had to do was in the category class was check if the category was 1 or 0 if anyone is interested more than happy to share the code.
  10. douglaswalker

    [Addon] Modular Navigation Bar (Bootstrap)

    Hi there @kymation I use you modular navigation code.. and use the simple drop down categories module. I am trying to find a way to not show a category in the drop down if there are no products in the category. I thought that the way to do this must be somewhere in the category class... Would you know how to do this (can it be done) or give me an idea of how. i know there are contributions for it but they deal with very different code. many thanks Doug
  11. douglaswalker

    breadcrumbs

    Hi there hoping to pick the brains of SEO interested people here. Breadcrumbs currently show as Home > Page you came from > page you are on Or something similar. The schema picks all this up and it passes the schema test at Google. However the page you are on is shown as a link in the breadcrumb.. so in effect it is just linking to it's self. Is this ok for SEO... many things I have read say a page linking to itself is not such a good idea. So my question is if I don't want it to be a link and just plain text how can i do this and still have it pass the schema test. I know I can just change the breadcrumb link in the code and remove the tep_href part but then the schema doesn't pass as the breadcrumb relies on a function to produce the correctly formatted schema and that relies on the link anyway any thoughts? schema function <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ class breadcrumb { var $_trail; function breadcrumb() { $this->reset(); } function reset() { $this->_trail = array(); } function add($title, $link = '') { $this->_trail[] = array('title' => $title, 'link' => $link); } function trail($separator = NULL) { $pos = 1; $trail_string = '<ol itemscope itemtype="http://schema.org/BreadcrumbList" class="breadcrumb">'; for ($i=0, $n=sizeof($this->_trail); $i<$n; $i++) { if (isset($this->_trail[$i]['link']) && tep_not_null($this->_trail[$i]['link'])) { $trail_string .= '<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a href="' . $this->_trail[$i]['link'] . '" itemprop="item"><span itemprop="name">' . $this->_trail[$i]['title'] . '</span></a>'; } else { $trail_string .= '<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><span itemprop="name">' . $this->_trail[$i]['title'] . '</span>'; } $trail_string .= '<meta itemprop="position" content="' . (int)$pos . '" /></li>' . PHP_EOL; $pos++; } $trail_string .= '</ol>'; return $trail_string; } } ?> code on page to call function $breadcrumb->add('Policies', tep_href_link('policies.php')); $breadcrumb->add('AfterPay', tep_href_link('afterpay.php'));
  12. douglaswalker

    [CONTRIBUTION] Ultimate SEO URLs v2.1 - by Chemo

    Please ignore the post above @Jack_mcs solution is absolutely right. I made a mistake with the URL. Thanks all for your help
  13. douglaswalker

    [CONTRIBUTION] Ultimate SEO URLs v2.1 - by Chemo

    @Jack_mcs 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
  14. douglaswalker

    [CONTRIBUTION] Ultimate SEO URLs v2.1 - by Chemo

    @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
  15. douglaswalker

    [CONTRIBUTION] Ultimate SEO URLs v2.1 - by Chemo

    @Hotclutch hi there unfortunately it results in this... name-of-product-p-40.html?products_id=33 A similar issue is here https://forums.oscommerce.com/topic/408028-301-redirects-and-seo-urls/ to do with category redirects
  16. douglaswalker

    Google XML Sitemap SEO

    Hi there in the pages part of this addon I see you can disallow a page so my question is On my site index.php is re-directed to home https://www.mysite.com.au/ index.php is in my sitemap but google rightly has chosen https://www.mysite/ as the canonical tag. Is there a way instead of having index.php in the sitemap have https://www.mysite.com.au/ or should I just add index.php to the disallow list.
  17. douglaswalker

    [CONTRIBUTION] Ultimate SEO URLs v2.1 - by Chemo

    Hi there I am using this contribution and I am trying to 301 redirect an old product I no longer stock to a new one. like this in htaccess redirect 301 /product-p-800.html https://www.site.com/product-p-900.html however i am finding that it will not work anymore. Is there a different way i have to do a permanent redirect on a product when SEO urls is implemented or have I totally missed something
  18. douglaswalker

    [CONTRIBUTION] Ultimate SEO URLs v2.1 - by Chemo

    @Jack_Mcs thank-you that certainly worked. Should I also place cpath lowercase for google to ignore?
  19. douglaswalker

    [CONTRIBUTION] Ultimate SEO URLs v2.1 - by Chemo

    Hi there I tried the above in application top and then tested the incorrect link eg cpath instead of cPath I still just got the page trying to redirect and finally fail.
  20. douglaswalker

    [CONTRIBUTION] Ultimate SEO URLs v2.1 - by Chemo

    @Jack_mcs thank-you so would i just add cpath I can see in the console that cPath is already listed as not changing content (this was google that put that there not me) There are warnings everywhere about changing things How would i do this @BrockleyJohn Do you mean you are working out a way to stop the issue Really appreciate all the help guys
  21. douglaswalker

    [CONTRIBUTION] Ultimate SEO URLs v2.1 - by Chemo

    Ahh i see what you mean i missed that it looks like it is happening with the reviews run-pr-103.html?page=2&cpath=23 soldier-pr-282.html?cpath=23 very puzzled now
  22. douglaswalker

    [CONTRIBUTION] Ultimate SEO URLs v2.1 - by Chemo

    interesting thanks for that Those are the old URLs with the correct cPath that haven't been dropped yet. The new urls are in the process of showing up
  23. douglaswalker

    [CONTRIBUTION] Ultimate SEO URLs v2.1 - by Chemo

    I am seeing the new urls, correctly formatted, beginning to show up in search results. I only have the one issue in webmaster tools with cpath
  24. douglaswalker

    [CONTRIBUTION] Ultimate SEO URLs v2.1 - by Chemo

    I always like it when someone with greater knowledge than mine tells me not to worry. So I am now here in Australia not worrying
×