chongshengdz Posted April 28, 2018 Share Posted April 28, 2018 my manually entered product Custom SEO URL Path is different from the breadcrumbs and alternate tags (<link rel="alternate") on the product detail page. for example. i manually entered category/product-detail- it will only show on breadcrumbs and alternate tags (<link rel="alternate") on the product detail page as below: category/product-detail and the product will become not found when you click on breadcrumbs or change languages. how to fix this? please help. Quote Link to comment Share on other sites More sharing options...
bsmither Posted April 29, 2018 Share Posted April 29, 2018 We would ask if you have an actual need for a trailing dash character. If not, please use simply category/product-detail without the trailing dash. Quote Link to comment Share on other sites More sharing options...
chongshengdz Posted April 29, 2018 Author Share Posted April 29, 2018 how to disable auto-generated product Custom SEO URL Path and not to update to database and only read product Custom SEO URL Path from database when opening a product page? Quote Link to comment Share on other sites More sharing options...
bsmither Posted April 29, 2018 Share Posted April 29, 2018 CubeCart will auto-generate a Custom SEO URL Path unless you enter something of your own specification. In admin, Edit Product, Search Engines tab, enter your own path. It can be anything, but must begin and end with a letter or number. Quote Link to comment Share on other sites More sharing options...
chongshengdz Posted April 29, 2018 Author Share Posted April 29, 2018 but if start or end with a trailing dash character,it will not work. how to fix this? Quote Link to comment Share on other sites More sharing options...
bsmither Posted April 29, 2018 Share Posted April 29, 2018 Do not use a leading or trailing dash character. Quote Link to comment Share on other sites More sharing options...
chongshengdz Posted April 29, 2018 Author Share Posted April 29, 2018 it must use. because they are selected from title and auto replace empty spaces with a trailing dash character do you know how to bulk remove trailing dash characters at the end from database? Quote Link to comment Share on other sites More sharing options...
bsmither Posted April 29, 2018 Share Posted April 29, 2018 I understand you have a need to have trailing dashes. This edit may work. To prevent CubeCart from "trimming" leading and trailing dashes, then in /classes/seo.class.php: Near the end of the file, find: private static function _safeUrl($url) { Then, seven lines later, find: return trim($url,'-'); Change this line to: return $url; // trim($url,'-'); Quote Link to comment Share on other sites More sharing options...
chongshengdz Posted April 29, 2018 Author Share Posted April 29, 2018 1 hour ago, bsmither said: I understand you have a need to have trailing dashes. This edit may work. To prevent CubeCart from "trimming" leading and trailing dashes, then in /classes/seo.class.php: Near the end of the file, find: private static function _safeUrl($url) { Then, seven lines later, find: return trim($url,'-'); Change this line to: return $url; // trim($url,'-'); thanks,it woks great. the problem has been resolved. Quote 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.