Forum Moderators: Robert Charlton & goodroi
A description for this result is not available because of this site's robots.txt - learn more [support.google.com]
lee_sufc:2) Changes all internal links on that page to absolute links using 'http://'
phranque:2) you should refer to the canonical url which in this case starts with [<...]
lee_sufc:@phranque - in relation to 2) does this mean I should change all links in the cart page to be secure? (at present the page links to non-https versions).
phranque:- if your cart page uses secure protocol then you should link to secure protocol.
otherwise you are requiring a 301 redirect every time someone clicks through to your cart page.
I think phranque and lee_sufc talk cross-wired here.
"That page" in the first lee_sufc quote above is a cart page. What I believe lee_sufc asks is whether outgoing links from the cart page should be changed to link to http version of other pages by using the fully qualified URL.
My response is yes - for all outgoing links that use http. Because if you use root-relative href= then you will have https schema for your non-https pages.
To further qualify: If you for example have a main nav where all links are normally http, then when on https cart page, this main nav should be fully qualified href="http://example.com/main-nav-link1" etc and not href="/main-nav-link1" as the second one will then lead to https version of the page, which is not what you want.
Equally, link to cart from other pages should be fully qualified with https.[edited by: aakk9999 at 11:15 pm (utc) on Oct 29, 2013]
# Keep the bots off the cart page and the page out of the index
RewriteCond %{HTTP_USER_AGENT} (:?google|bing)bot [NC]
RewriteRule cart\.html$ - [F]
RewriteCond %{HTTPS}<>%{REQUEST_URI} !^off<>/cart\.html$
<> is an arbitrary delimeter that would never appear in a real request. Its use here is merely to unambiguously concatentate two pieces of data.
Now, if someone else can translate that into English wink Is it hidden in the apache docs somewhere?
RewriteEngine On
RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} !cart.html
RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} !^(www\.example\.com)$ [OR]
RewriteCond %{HTTPS}<>%{REQUEST_URI} !^off<>/cart\.html$
RewriteRule .? http://www.example.com%{REQUEST_URI} [R=301,L]
[edited by: aakk9999 at 5:40 pm (utc) on Oct 30, 2013]
[edit reason] Unlinked RewriteRule [/edit]
but how would it prevent indexing?
Now, if someone else can translate that into English ;)
RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
and somehow this does not result in 500 consecutive server explosions.
[edited by: JD_Toims at 10:08 pm (utc) on Oct 30, 2013]