ModPagespeedMapRewriteDomain and ModPagespeedDisallow

110 views
Skip to first unread message

Kim Frederiksen

unread,
Aug 19, 2014, 5:48:52 AM8/19/14
to mod-pagesp...@googlegroups.com
Hi all,

It seems that ModPagespeedMapRewriteDomain is not respecting ModPagespeedDisallow.

I am trying to avoid getting .ttf, .eot and .woff files served through my CDN as it creates problems in firefox with Cross Domain issues. So I wish to disallow these filetypes from getting rewritten with the CDN domain.

Here is my configuration for this.

ModPagespeedDisallow "*.ttf"
ModPagespeedDisallow "*.woff"
ModPagespeedDisallow "*.eot"

This is put in pagespeed.conf

In the .htaccess for my site I have the following.

ModPagespeed on
ModPagespeedMapRewriteDomain heycdn.hellerupparkhotel.dk hellerupparkhotel.dk

Here is the output from console with the above configuration active:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://heycdn.hellerupparkhotel.dk/wp-content/plugins/simple-social-icons/font/fontello.woff?78492063. This can be fixed by moving the resource to the same domain or enabling CORS.

Naturally pagespeed has not done any optimization on the font, but it still rewrites the domain.

Shouldn't ModPagespeedMapRewriteDomain respect ModPagespeedDisallow matches?

Please advise.

Thanks,

Kim Frederiksen

Joshua Marantz

unread,
Aug 19, 2014, 8:49:37 AM8/19/14
to mod-pagespeed-discuss
This is a reasonable enhancement request, but I can't promise it could be done quickly.  I scanned your site, though, and I have a suggestion.  Put in this Disallow:

ModPagespeedDisallow */wp-content/plugins/simple-social-icons/css/style.css*

While this is not optimal -- it won't inline or minify that CSS -- it won't rewrite the font URLs in it either.

mod_pagespeed needs a more comprehensive mechanism to indicate distinct allow/disallow patterns for each filter.  We just haven't been able to get to it.

-Josh

satish....@gmail.com

unread,
Mar 9, 2017, 4:06:02 PM3/9/17
to mod-pagespeed-discuss
Hi,

any update on the enhancement:     ModPagespeedMapRewriteDomain is not respecting ModPagespeedDisallow.

I am trying to avoid getting domains rewritten to CDN domain for these files 

ModPagespeedDisallow "*.ttf"
ModPagespeedDisallow "*.woff"
ModPagespeedDisallow "*.eot"

thanks,
Satish

Rob

unread,
Oct 11, 2018, 11:46:18 AM10/11/18
to mod-pagespeed-discuss
Looks like this has still not been resolved. In my case it's a sharding setup using Amazon Cloudfront. We're seeing CORS violations for .ttf and .woff files because they are served from the CDN, even though these file types are disallowed in Mod_Pagespeed. I can't set up CORS headers coming from Cloudfront, so there is no way to get browsers to allow these files.

I'll try the workaround excluding the specific paths these files come from. It would be nice if this bug got fixed after 4 years...

-Rob-

Otto van der Schaaf

unread,
Oct 16, 2018, 5:20:37 AM10/16/18
to mod-pagesp...@googlegroups.com
Couldn't you set the CORS headers at the origin (and have CF pass them on)?

Otto

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/6e1c600c-193f-4a61-8337-e40f0870d9ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages