Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

AutoSSL for many RewriteRules?

Discussion in 'Security' started by ValeryVK, Jul 30, 2018.

Tags:
  1. ValeryVK

    ValeryVK Registered

    Joined:
    Jul 30, 2018
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Belarus
    cPanel Access Level:
    Website Owner
    Hello,

    I have many RewriteRule in my .htaccess file. According to the documentation, I have to add the following code before each RewriteRule:
    RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt$
    RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$

    For me, it looks duplications. Can I set AutoSSL off, remove all code above before each RewriteRule and add the following code after "RewriteBase /" ? :
    RewriteCond %{REQUEST_URI} ^/[A-F0-9]{32}\.txt$ [OR]
    RewriteCond %{REQUEST_URI} ^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
    RewriteRule .* - [L]

    Pay attentions, I removed ! (NOT), added [OR] and RewriteRule.

    Am I missing something? Or my idea will work without any problems?

    Regards,
    Valery.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,367
    Likes Received:
    1,857
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello Valery,

    The better approach is to simply enable the following option under the Domains tab in WHM >> Tweak Settings:

    Use a Global DCV Passthrough instead of .htaccess modification (requires EA4)

    This allows you to avoid the .htaccess modification step during the AutoSSL validation process. Do you have root access to the server to enable this option? If not, can you check with your web hosting provider to see if they can enable it on the server?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice