bobafifi Posted July 1, 2017 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! Link to comment Share on other sites More sharing options...
bobafifi Posted July 1, 2017 Author 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. Link to comment Share on other sites More sharing options...
bobafifi Posted July 1, 2017 Author Share Posted July 1, 2017 Got it! <?php if (false !== strpos($_SERVER['REQUEST_URI'], 'lna')) { echo 'A-Z';}?> Link to comment Share on other sites More sharing options...
Larry Posted July 3, 2017 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! Link to comment Share on other sites More sharing options...
bobafifi Posted July 5, 2017 Author 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 Link to comment Share on other sites More sharing options...
Recommended Posts