Disallow cPanel in the default .conf, use of ? wildcard

35 views
Skip to first unread message

Jason Carlton

unread,
Jul 5, 2022, 8:31:16 PM7/5/22
to mod-pagespeed-discuss
The default 510_pagespeed.conf file includes two lines:

ModPagespeedDisallow "http://cpanel.*"
ModPagespeedDisallow "https://cpanel.*"

Is there a reason that it didn't use the ? wildcard to keep it on one line? Like so:

ModPagespeedDisallow "https?://cpanel.*"

Longinos

unread,
Jul 6, 2022, 5:53:21 AM7/6/22
to mod-pagespeed-discuss
I'm not sure if "?" is a valid symbol, but for sure "*" is permited.
So ModPagespeedDisallow "https*://cpanel.*"must work.
In fact I use it to aut domains:
ModPagespeedDomain http*://*.domain.com

Jason Carlton

unread,
Jul 6, 2022, 1:17:18 PM7/6/22
to mod-pagespeed-discuss
From the docs:

Wildcards include * which matches any 0 or more characters, and ?, which matches exactly one character. Unlike Unix shells, the / directory separator is not special, and can be matched by either * or ?. The resources are always expanded into their absolute form before expanding.
https://www.modpagespeed.com/doc/restricting_urls

That's not exactly clear; I'm assuming that ? is like in a regex and matches 0 OR 1? Because if it matched exactly 1 then it would be irrelevant.

If I'm right that ? matches 0 or 1 then I wasn't sure if there was a specific reason to use two lines instead of a wildcard (speed to process, maybe?), or if it's just something from the olden days that hadn't been updated. I use * throughout my configuration, too, but in most cases I really just want it to match 0 or 1. The ? wildcard is marginally faster in regex, so it would be a better choice if it works the same here.

Longinos

unread,
Jul 7, 2022, 12:46:43 PM7/7/22
to mod-pagespeed-discuss
I don't know why cPanel set this way......
Reply all
Reply to author
Forward
0 new messages