Support » Plugins and Hacks » WordPress HTTPS (SSL) » [Resolved] Warning: preg_match(): Unknown modifier 'c' in /DomainMapping.php on line 43

[Resolved] Warning: preg_match(): Unknown modifier 'c' in /DomainMapping.php on line 43

  • I receive this warning message three times when I’m in the /checkout page:

    Warning: preg_match(): Unknown modifier 'c' in /home/grievingtogether/public_html/wp-content/plugins/wordpress-https/lib/WordPressHTTPS/Module/DomainMapping.php on line 43


    SSL Host: domain.com
    Port: blank
    Force SSL Admin: checked
    Force SSL Exclusively: checked
    Remove Unsecure Elements: unchecked
    Debug Mode: unchecked
    Proxy: No
    Admin Menu Location: Settings.

    Secure Filters:

    I’m using WordPress 3.8.1. Also, the HTTPS is working just fine, but with those warnings at the top of the page.



Viewing 7 replies - 1 through 7 (of 7 total)
  • I went to the line and tried a few things.

    (1) preg_quote($http_domain, ‘/’)
    – This would change “\d.gravatar.com” to “\\d\.gravatar\.com”. Which is right, but we need the \d to be parsed as regexp.

    (2) preg_match(‘|’ . $http_domain . ‘|’, $url, $matches);
    – I changed the delimiters to another character, but again, we could be using it inside the regexp.

    (3) str_replace(‘/’, ‘\/’, $http_domain)
    – I just decided to use this one. It is working fine, no more warnings. Try it out and make the fix if applicable and/or give me a recommendation please.



    I’m having the same problem.

    The “preg_match(): Unknown modifier ‘c’ in /home/grievingtogether/public_html/wp-content/plugins/wordpress-https/lib/WordPressHTTPS/Module/DomainMapping.php on line 43”

    isn’t on all the pages. Main homepage, main tabs are working fine. Except when I go to the menu and scroll down and select.

    I’m not sure what’s going on.

    The website is http://www.olivias4tea.com

    You can see the error on https://olivias4tea.com/olivias-dollhouse-tea-room/

    Any help would be greatly appreciated.


    Go to the file and line below:

    /wp-content/plugins/wordpress-https/lib/WordPressHTTPS/Module/DomainMapping.php on line 43


    preg_match(‘/’ . $http_domain . ‘/’, $url, $matches);


    preg_match(‘/’ . str_replace(‘/’, ‘\/’, $http_domain) . ‘/’, $url, $matches);

    Hi Marco,

    thanks so much!

    It works.

    Glad to help. You’re welcome 🙂

    Marking it as solve.

    Well, actually, the plugin author should apply this fix. Hope he/she does. Still a great plugin! Thanks.

    Perhaps they should but I guess they didn’t ’cause I ran into the same problem (WordPress 4.0, plugin WordPress HTTPS 3.3.6) but with a ‘p’ instead of ‘c’. But it seems like the same solution as you proposed above did the trick, again 🙂
    Great stuff, thanks !

    No more Warnings 🙂


Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Resolved] Warning: preg_match(): Unknown modifier 'c' in /DomainMapping.php on line 43’ is closed to new replies.
Skip to toolbar