URL mapping not working as expected

65 views
Skip to first unread message

Praveen Rajappan

unread,
Jan 20, 2016, 1:50:50 PM1/20/16
to mod-pagespeed-discuss

Hi,


Intention was to configure the page to include only page and exclude others


www.demo.com

www.demo.com/index.jsp

www.demo.com/en-US/index.jsp


Initially I had below config:


ModPagespeedDisallow "*"

ModPagespeedDisallow "*.cat*"

ModPagespeedDisallow "*.prod*"

ModPagespeedDisallow "*.service*"

ModPagespeedDisallow "*/js/*"

ModPagespeedDisallow "*.jsp"

ModPagespeedAllow "*/"

ModPagespeedAllow "*/?*"

ModPagespeedAllow "*/index.jsp*"

ModPagespeedAllow "*/??-??/index.jsp*"

ModPagespeedAllow "*/jsbundle/*"

ModPagespeedAllow "*/cssbundle/*"


With above config, http://www.demo.com/index.jsp and http://www.demo.com/en-ES/index.jsp works as expected but it would not work for http://www.demo.com/


So I tweaked below and it worked as expected but just that it started working on URL like http://www.demo.com/mail.jsp as well which was NOT desired. 


ModPagespeedDisallow "*"

## Allow enviroment specific host

ModPagespeedAllow "*demo.com/?*"



## Allow specific path for phase 1

ModPagespeedAllow "*/index.jsp*"

ModPagespeedAllow "*/??-??/index.jsp*"

ModPagespeedAllow "*/jsbundle/*"

ModPagespeedAllow "*/cssbundle/*"


## Disallow explicit known folders and extension to be safe

ModPagespeedDisallow "*/js/*"

ModPagespeedDisallow "*.cat*"

ModPagespeedDisallow "*.prod*"

ModPagespeedDisallow "*/checkout/*"

ModPagespeedDisallow "*/account/*"

ModPagespeedDisallow "*services*"


Any suggestion? Thanks!

Jeff Kaufman

unread,
Jan 20, 2016, 1:54:59 PM1/20/16
to mod-pagespeed-discuss
What about:

ModPagespeedDisallow "*"
ModPagespeedAllow "http://www.demo.com"
ModPagespeedAllow "http://www.demo.com/index.jsp"
ModPagespeedAllow "www.demo.com/en-US/index.jsp"

Note that this won't let pagespeed rewrite your images, css files, or js files.
> --
> 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/07fa5927-e9bc-4691-b332-0d1e1e3d1089%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Praveen Rajappan

unread,
Jan 20, 2016, 1:58:34 PM1/20/16
to mod-pagespeed-discuss
Thanks Jeff! Will experiment and update here!

Does URL control allow regex - my understand is no! Am I correct?

Regards
Praveen

Jeff Kaufman

unread,
Jan 20, 2016, 2:20:46 PM1/20/16
to mod-pagespeed-discuss
URL control allows wildcards, but not regexes. So you would write:

ModPagespeedAllow "*.js"

And not:

ModPagespeedAllow ".*[.]js$"
> --
> 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/4841457f-cf28-44b0-a887-67a2c71f139b%40googlegroups.com.

Praveen Rajappan

unread,
Jan 22, 2016, 3:11:44 PM1/22/16
to mod-pagespeed-discuss
A related question.. I want to  make sure that PageSpeed module acts upon only on certain domain only like demo.com/www.demo.com/origin-www.demo.com and other requests should be ignored.. is that possible?

Jeff Kaufman

unread,
Jan 22, 2016, 3:13:07 PM1/22/16
to mod-pagespeed-discuss
The easiest way to do this is to split things by vhost. Have
PageSpeed turned off at the top level, and turn it on only for the
vhosts you want it to run on.
>> > email to mod-pagespeed-di...@googlegroups.com.
> --
> 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/e3053184-b9d8-43ab-ad01-6816e5982c0f%40googlegroups.com.

Praveen Rajappan

unread,
Jan 22, 2016, 5:49:45 PM1/22/16
to mod-pagespeed-discuss
Ok Thanks! I shall explore this option! 
Reply all
Reply to author
Forward
0 new messages