minesweeper Posted July 28, 2012 Share Posted July 28, 2012 Hello!. Respect to everyone. I would be more than grateful if you could explain me the way to do the following: I just want to know how to detect if https is enabled and if so write <META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"> at the head section. I use <link rel="canonical" href="http://www.mydomain.com/" /> but I think this will bring extra safety. I think this is very useful for everyone because in this way we could assure there will no "https" duplicate content issues. I've tried many ways but all of them return compile errors. Could someone help me please? Link to comment Share on other sites More sharing options...
oka Posted July 28, 2012 Share Posted July 28, 2012 I use this code to detect if a customer is using https {Tools::getCurrentUrlProtocolPrefix()} Regards. Link to comment Share on other sites More sharing options...
minesweeper Posted July 28, 2012 Author Share Posted July 28, 2012 Thank you for the fast response Oka. But it isn't clear for me yet. Sorry. How do I use that to write <META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"> if the page uses https?. Regards Link to comment Share on other sites More sharing options...
minesweeper Posted July 28, 2012 Author Share Posted July 28, 2012 (edited) Done!. This is the code: {if Tools::getCurrentUrlProtocolPrefix() == 'https://'} <meta name="robots" content="noindex,nofollow" /> {/if} works like a charm!. If you want to avoid "https" duplicate issues this is your code as well as: <link rel="canonical" href="http://www.yourdomain.com{$smarty.server.REQUEST_URI}" /> with this is almost impossible to have duplicate content issues. Thank you Oka! Gracias! Edited July 28, 2012 by minesweeper (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts