Results 1 to 2 of 2
  1. #1
    Progger's Avatar
    Progger is offline Public Member
    Join Date
    November 2014
    Location
    New Zealand
    Posts
    1,420
    Thanks
    282
    Thanked 923 Times in 580 Posts

    Default .htaccess rules / exlude one folder ?!

    Hello

    This is my htaccess with some http-https rules - i try to exlude one folder from the rules - after 2 hours i got it, but i want a OK from a pro



    PHP Code:
    RewriteOptions inherit
    ### RewriteEngine On ###
    RewriteCond %{REQUEST_URI} !^/FOLDER-EXCLUDE/.*$         <<<<< NEW CODE <<<<<<<<<<<<<<<<<<<<<<<<<<<
    <
    IfModule mod_rewrite.c>
    RewriteEngine On
    ### http -> https ###
    RewriteCond %{HTTPS} off
    RewriteCond 
    %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
    RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
    RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
    RewriteRule (.*) https://domain.com%{REQUEST_URI} [R=301,L]
    ### Rewrite application ###
     
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond 
    %{REQUEST_FILENAME} !-d
    RewriteCond 
    %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
    RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
    RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
    RewriteRule ^(.*)$ index.php?$1 [L,QSA]
    ### Close RewriteEngine ###
    </IfModule>
    <
    Files 403.shtml>
    order allow,deny
    allow from all
    </Files> 
    The new code is in the 3 line,with the exclude rule, is this OK?

    I know the another method with "RewriteEngine off" but this is not a way - because the server load goes up!

    Regards

  2. #2
    Progger's Avatar
    Progger is offline Public Member
    Join Date
    November 2014
    Location
    New Zealand
    Posts
    1,420
    Thanks
    282
    Thanked 923 Times in 580 Posts

    Default

    update.

    I invest some hours to exclude a second domain/folder from this rule - NOTHING WORKS!

    But i force ssl for the second domain,
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule
    and this works now

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •