bobafifi 1 Posted July 1, 2017 Report Share Posted July 1, 2017 Hi Larry, Google Webmaster tools is flagging this script for making duplicate page titles. Can you please tell me how best to append/echo the sort order to the page Title in the HTML (switch $link1, $link2, $link3 - lnd, lna, fnd, fna, drd, dra)? Thanks! Quote Link to post Share on other sites
bobafifi 1 Posted July 1, 2017 Author Report Share Posted July 1, 2017 OK - I got something working (not ideal). Made a new variable: <?php $pageTitle = "$_SERVER[REQUEST_URI]"; ?> and then in the title tags <title>Example <?php echo $pageTitle ; ?></title> Depending on the sort order, would like to change $pageTitle to echo different text, for example "A-Z" or "Z-A" (instead of /example.php?sort=lnd), but at least this prints unique page titles. Quote Link to post Share on other sites
bobafifi 1 Posted July 1, 2017 Author Report Share Posted July 1, 2017 Got it! <?php if (false !== strpos($_SERVER['REQUEST_URI'], 'lna')) { echo 'A-Z';}?> Quote Link to post Share on other sites
Larry 428 Posted July 3, 2017 Report Share Posted July 3, 2017 Glad you got it working! I'm not positive that different sorts should be treated as different pages but it's cool you found a solution regardless! Quote Link to post Share on other sites
bobafifi 1 Posted July 5, 2017 Author Report Share Posted July 5, 2017 (edited) Hi Larry, I agree - the sort order shouldn't constitute duplicate pages as there really is no new content being generated, just the same stuff rearranged. However for some reason, Google thinks differently. Maybe because the URL changes slightly, that's all it takes. They can't be sure if it's a new page or not, so they just go with new page? -Bob Edited July 5, 2017 by bobafifi Quote Link to post Share on other sites
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.
Note: Your post will require moderator approval before it will be visible.