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!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Comodo entries in htaccess

Discussion in 'Security' started by GoWilkes, Mar 5, 2018.

  1. GoWilkes

    GoWilkes Well-Known Member

    Joined:
    Sep 26, 2006
    Messages:
    397
    Likes Received:
    5
    Trophy Points:
    168
    cPanel Access Level:
    Root Administrator
    I found several topics on this, but no solution that seemed "great".

    My issue is with these 3 lines added to the htaccess file before every RewriteCond:

    Code:
    RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
    RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
    RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
    In my case, I have 26 RewriteCond lines, so now I have a huge, difficult to manage htaccess file. So I'm trying to come up with an alternative.

    Can I not just place something like this at the top of the htaccess, then eliminate all of the duplicated lines?

    Code:
    RewriteEngine On
    RewriteCond %{REQUEST_URI} ^/[0-9]+\..+\.cpaneldcv$ [OR]
    RewriteCond %{REQUEST_URI} ^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$ [OR]
    RewriteCond %{REQUEST_URI} ^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ 
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteRule  (.*) - [L]
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,134
    Likes Received:
    365
    Trophy Points:
    583
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
Loading...

Share This Page