Forcing http to https redirects and the affect on pagespeed mod...

594 views
Skip to first unread message

Cameron Kellett

unread,
Nov 19, 2017, 10:30:40 PM11/19/17
to mod-pagespeed-discuss
Hi,

I have have successfully enabled SSL settings for pagespeed  running on apache. However, forcing a http to https re-direct via apache's RewriteEngine prevents pagespeed mod from fetching the required resources.
To make changes to filter settings I basically need to disable the redirect, manually flush for it to work. I can then re-enable the re-direct.I assume pagespeed is looking for original http resources, being forced to the https domain and therefore not finding the resources.
This obviously causes issues whenever pagespeed automatically flushes cache.

Is there a domain mapping configuration I need to use to work around this???

Cheers...




Longinos

unread,
Nov 20, 2017, 2:25:45 AM11/20/17
to mod-pagespeed-discuss
Hi
Have you auth the https domain?

ModPageSpeedDomain http*://*.mydomain.com is the better way to do, I think, this auth the http and https and al the subdomains.
And to redirect http to https don´t forget to set R=301 in the rewrite rule.

Cameron Kellett

unread,
Nov 20, 2017, 8:57:14 PM11/20/17
to mod-pagespeed-discuss
Thanks for the assistance and R=301 heads up. 

Unfortunately that didn't fix the issue. Btw, I have set the ModPagespeedMapOriginDomain "http://cameronkellett.com" "https://cameronkellett.com"

I tried the wild card you suggested for ModPagespeedDomain as well as setting the domains explicitly. (This is ignored anyway due to the domain being already mapped via the ModPagespeedMapOriginDomain setting)

I currently have the redirect commented out. However the redirect to https still works...I don't know why. I assume it's been cached during the DNS propagation process.

:/

Longinos

unread,
Nov 21, 2017, 2:38:43 AM11/21/17
to mod-pagespeed-discuss
I tried the site https://cameronkellett.com and had no error. Resources from these site become rewrited, resources from other sites not, as spected.
These are the enabled filters i can see with https://cameronkellett.com?PageSpeedFilters=+debug

mod_pagespeed on

Filters:

ah Add Head

cw Collapse Whitespace

cc Combine Css

jc Combine Javascript

mc Convert Meta Tags

db Debug

ea Elide Attributes

ec Cache Extend Css

ei Cache Extend Images

es Cache Extend Scripts

fc Fallback Rewrite Css

if Flatten CSS Imports

hw Flushes html

ci Inline Css

il Inline @import to Link

cm Move Css To Head

cf Rewrite Css

jm Rewrite External Javascript

jj Rewrite Inline Javascript

cu Rewrite Style Attributes With Url



Options:

CssInlineMaxBytes (ci) 2000000

EnableRewriting (e) 1

FetchWithGzip (afg) True

FileCacheCleanIntervalMs (afcci) 3600000

FileCacheInodeLimit (afcl) 500000

ImplicitCacheTtlMs (ict) 360000000

JsInlineMaxBytes (ji) 2000000

LazyloadImagesAfterOnload (llio) False

RewriteDeadlinePerFlushMs (rdm) -1

RunExperiment (fur) False

Statistics (ase) True

StatisticsLogging (asle) True



#NumFlushes 0

#EndDocument after 9411us

#Total Parse duration 1138us

#Total Render duration 11498us

#Total Idle duration 8273us

The following filters were disabled for this request:

SupportNoscript

Cameron Kellett

unread,
Nov 21, 2017, 5:41:38 PM11/21/17
to mod-pagespeed-discuss
Thanks for confirming it works. I currently have the redirect RewriteEngine disabled. 
I am now thinking that ModPagespeedMapOriginDomain  takes care of the redirect/rewrite. So by enabling my own http to https redirect I am creating a conflict.  
Reply all
Reply to author
Forward
0 new messages