htaccess code overwritten

Home Forums BulletProof Security Pro htaccess code overwritten

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #38506
    Edwin
    Participant

    Hi

    I installed the pro-plugin for the first time and found that it overwrite the existing code in the .htaccess file.
    How to prevent it from doing that?

    #38507
    AITpro Admin
    Keymaster

    BPS has a feature called Custom Code (BPS Pro > B-Core > Custom Code tab page) where you can save any custom, personal or additional htaccess code permanently and that custom, personal or additional htaccess code will be created in your root htaccess file. What htaccess code was overwritten? A backup of your root htaccess file is automatically created in this folder:  /wp-content/bps-backup/master-backups/root.htaccess-2019-1-13-12-26-54-pm. Post the htaccess code that you want to add to BPS Root Custom so I can tell which Custom Code text box the htaccess code goes in.

    #38508
    Edwin
    Participant

    Thanks for the quick reply
    Below:

    # Compress HTML, CSS, JavaScript, Text, XML and fonts
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/rss+xml
    AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
    AddOutputFilterByType DEFLATE application/x-font
    AddOutputFilterByType DEFLATE application/x-font-opentype
    AddOutputFilterByType DEFLATE application/x-font-otf
    AddOutputFilterByType DEFLATE application/x-font-truetype
    AddOutputFilterByType DEFLATE application/x-font-ttf
    AddOutputFilterByType DEFLATE application/x-javascript
    AddOutputFilterByType DEFLATE application/xhtml+xml
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE font/opentype
    AddOutputFilterByType DEFLATE font/otf
    AddOutputFilterByType DEFLATE font/ttf
    AddOutputFilterByType DEFLATE image/svg+xml
    AddOutputFilterByType DEFLATE image/x-icon
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE text/html
    AddOutputFilterByType DEFLATE text/javascript
    AddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/xml
    
    # Remove browser bugs (only needed for really old browsers)
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4\.0[678] no-gzip
    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
    Header append Vary User-Agent
    
    # BEGIN LSCACHE
    ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
    
    RewriteEngine on
    CacheLookup on
    RewriteRule .* - [E=Cache-Control:no-autoflush]
    RewriteRule ^min/\w+\.(css|js) - [E=cache-control:no-vary]
    
    ### marker MOBILE start ###
    RewriteCond %{HTTP_USER_AGENT} Mobile|Android|Silk/|Kindle|BlackBerry|Opera\ Mini|Opera\ Mobi [NC]
    RewriteRule .* - [E=Cache-Control:vary=ismobile]
    ### marker MOBILE end ###
    
    ### marker CACHE RESOURCE start ###
    RewriteRule wp-content/.*/[^/]*(responsive|css|js|dynamic|loader|fonts)\.php - [E=cache-control:max-age=3600]
    ### marker CACHE RESOURCE end ###
    
    ### marker FAVICON start ###
    RewriteRule favicon\.ico$ - [E=cache-control:max-age=86400]
    ### marker FAVICON end ###
    
    ### marker CORS start ###
    <FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|font\.css)$">
    
    Header set Access-Control-Allow-Origin "*"
    
    ### marker CORS end ###
    
    ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
    # END LSCACHE
    # BEGIN NON_LSCACHE
    ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
    ### marker BROWSER CACHE start ###
    
    ExpiresActive on
    ExpiresByType application/pdf A2592000
    ExpiresByType image/x-icon A2592000
    ExpiresByType image/vnd.microsoft.icon A2592000
    ExpiresByType image/svg+xml A2592000
    
    ExpiresByType image/jpg A2592000
    ExpiresByType image/jpeg A2592000
    ExpiresByType image/png A2592000
    ExpiresByType image/gif A2592000
    ExpiresByType image/webp A2592000
    
    ExpiresByType video/ogg A2592000
    ExpiresByType audio/ogg A2592000
    ExpiresByType video/mp4 A2592000
    ExpiresByType video/webm A2592000
    
    ExpiresByType text/css A2592000
    ExpiresByType text/javascript A2592000
    ExpiresByType application/javascript A2592000
    ExpiresByType application/x-javascript A2592000
    
    ExpiresByType application/x-font-ttf A2592000
    ExpiresByType application/x-font-woff A2592000
    ExpiresByType application/font-woff A2592000
    ExpiresByType application/font-woff2 A2592000
    ExpiresByType application/vnd.ms-fontobject A2592000
    ExpiresByType font/ttf A2592000
    ExpiresByType font/woff A2592000
    ExpiresByType font/woff2 A2592000
    
    ### marker BROWSER CACHE end ###
    
    ### marker MINIFY start ###
    
    RewriteEngine on
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} ^(.*)/min/(\w+)\.(css|js)$
    RewriteCond %1/wp-content/cache/$2/$1.$2 -f
    RewriteRule min/(\w+)\.(css|js) wp-content/cache/$2/$1.$2 [L]
    
    ### marker MINIFY end ###
    
    ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
    # END NON_LSCACHE
    
    # BEGIN LiteSpeed
    
    SetEnv noabort 1
    
    # END LiteSpeed
    # BEGIN WordPress
    # The directives (lines) between BEGIN WordPress and END WordPress are
    # dynamically generated, and should only be modified via WordPress filters.
    # Any changes to the directives between these markers will be overwritten.
    
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    
    # END WordPress
    # BEGIN MainWP
    
    # END MainWP
    
    RewriteCond %{HTTP_HOST} ^rotapanel\.com\.au$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.rotapanel\.com\.au$
    RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
    RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
    RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/(?:\ Ballot169)?
    RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Sectigo\ DCV)?$
    RewriteRule ^/?$ "https\:\/\/www\.rotapanel\.com\/home\/" [R=301,L]
    
    # BEGIN cPanel-generated php ini directives, do not edit
    # Manual editing of this file may result in unexpected behavior.
    # To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
    # For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)
    
    php_value default_socket_timeout 300
    php_flag display_errors Off
    php_value max_execution_time 90
    php_value max_input_time -1
    php_value max_input_vars 3000
    php_value memory_limit 512M
    php_value post_max_size 512M
    php_value session.gc_maxlifetime 1440
    php_value session.save_path "/var/cpanel/php/sessions/ea-php73"
    php_value upload_max_filesize 512M
    php_flag zlib.output_compression On
    
    php_value default_socket_timeout 300
    php_flag display_errors Off
    php_value max_execution_time 90
    php_value max_input_time -1
    php_value max_input_vars 3000
    php_value memory_limit 512M
    php_value post_max_size 512M
    php_value session.gc_maxlifetime 1440
    php_value session.save_path "/var/cpanel/php/sessions/ea-php73"
    php_value upload_max_filesize 512M
    php_flag zlib.output_compression On
    
    # END cPanel-generated php ini directives, do not edit
    
    # php -- BEGIN cPanel-generated handler, do not edit
    # Set the “ea-php73” package as the default “PHP” programming language.
    
    AddHandler application/x-httpd-ea-php73 .php .php7 .phtml
    
    # php -- END cPanel-generated handler, do not edit
    #38509
    AITpro Admin
    Keymaster

    I edited out the standard default WordPress Rewrite htaccess code because BPS htaccess code already incorporates that code.

    1. Copy the code below into this BPS Root Custom Code text box: 1. CUSTOM CODE TOP PHP/PHP.INI HANDLER/CACHE CODE
    2. Click the Save Root Custom Code button.
    3. Go to the BPS Security Modes page and click the Root Folder BulletProof Mode Activate button.

    # Compress HTML, CSS, JavaScript, Text, XML and fonts
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/rss+xml
    AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
    AddOutputFilterByType DEFLATE application/x-font
    AddOutputFilterByType DEFLATE application/x-font-opentype
    AddOutputFilterByType DEFLATE application/x-font-otf
    AddOutputFilterByType DEFLATE application/x-font-truetype
    AddOutputFilterByType DEFLATE application/x-font-ttf
    AddOutputFilterByType DEFLATE application/x-javascript
    AddOutputFilterByType DEFLATE application/xhtml+xml
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE font/opentype
    AddOutputFilterByType DEFLATE font/otf
    AddOutputFilterByType DEFLATE font/ttf
    AddOutputFilterByType DEFLATE image/svg+xml
    AddOutputFilterByType DEFLATE image/x-icon
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE text/html
    AddOutputFilterByType DEFLATE text/javascript
    AddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/xml
    
    # Remove browser bugs (only needed for really old browsers)
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4\.0[678] no-gzip
    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
    Header append Vary User-Agent
    
    # BEGIN LSCACHE
    ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
    
    RewriteEngine on
    CacheLookup on
    RewriteRule .* - [E=Cache-Control:no-autoflush]
    RewriteRule ^min/\w+\.(css|js) - [E=cache-control:no-vary]
    
    ### marker MOBILE start ###
    RewriteCond %{HTTP_USER_AGENT} Mobile|Android|Silk/|Kindle|BlackBerry|Opera\ Mini|Opera\ Mobi [NC]
    RewriteRule .* - [E=Cache-Control:vary=ismobile]
    ### marker MOBILE end ###
    
    ### marker CACHE RESOURCE start ###
    RewriteRule wp-content/.*/[^/]*(responsive|css|js|dynamic|loader|fonts)\.php - [E=cache-control:max-age=3600]
    ### marker CACHE RESOURCE end ###
    
    ### marker FAVICON start ###
    RewriteRule favicon\.ico$ - [E=cache-control:max-age=86400]
    ### marker FAVICON end ###
    
    ### marker CORS start ###
    <FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|font\.css)$">
    
    Header set Access-Control-Allow-Origin "*"
    
    ### marker CORS end ###
    
    ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
    # END LSCACHE
    # BEGIN NON_LSCACHE
    ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
    ### marker BROWSER CACHE start ###
    
    ExpiresActive on
    ExpiresByType application/pdf A2592000
    ExpiresByType image/x-icon A2592000
    ExpiresByType image/vnd.microsoft.icon A2592000
    ExpiresByType image/svg+xml A2592000
    
    ExpiresByType image/jpg A2592000
    ExpiresByType image/jpeg A2592000
    ExpiresByType image/png A2592000
    ExpiresByType image/gif A2592000
    ExpiresByType image/webp A2592000
    
    ExpiresByType video/ogg A2592000
    ExpiresByType audio/ogg A2592000
    ExpiresByType video/mp4 A2592000
    ExpiresByType video/webm A2592000
    
    ExpiresByType text/css A2592000
    ExpiresByType text/javascript A2592000
    ExpiresByType application/javascript A2592000
    ExpiresByType application/x-javascript A2592000
    
    ExpiresByType application/x-font-ttf A2592000
    ExpiresByType application/x-font-woff A2592000
    ExpiresByType application/font-woff A2592000
    ExpiresByType application/font-woff2 A2592000
    ExpiresByType application/vnd.ms-fontobject A2592000
    ExpiresByType font/ttf A2592000
    ExpiresByType font/woff A2592000
    ExpiresByType font/woff2 A2592000
    
    ### marker BROWSER CACHE end ###
    
    ### marker MINIFY start ###
    
    RewriteEngine on
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} ^(.*)/min/(\w+)\.(css|js)$
    RewriteCond %1/wp-content/cache/$2/$1.$2 -f
    RewriteRule min/(\w+)\.(css|js) wp-content/cache/$2/$1.$2 [L]
    
    ### marker MINIFY end ###
    
    ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
    # END NON_LSCACHE
    
    # BEGIN LiteSpeed
    
    SetEnv noabort 1
    
    # END LiteSpeed
    
    # BEGIN MainWP
    
    # END MainWP
    
    RewriteCond %{HTTP_HOST} ^rotapanel\.com\.au$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.rotapanel\.com\.au$
    RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
    RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
    RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/(?:\ Ballot169)?
    RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Sectigo\ DCV)?$
    RewriteRule ^/?$ "https\:\/\/www\.rotapanel\.com\/home\/" [R=301,L]
    
    # BEGIN cPanel-generated php ini directives, do not edit
    # Manual editing of this file may result in unexpected behavior.
    # To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
    # For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)
    
    php_value default_socket_timeout 300
    php_flag display_errors Off
    php_value max_execution_time 90
    php_value max_input_time -1
    php_value max_input_vars 3000
    php_value memory_limit 512M
    php_value post_max_size 512M
    php_value session.gc_maxlifetime 1440
    php_value session.save_path "/var/cpanel/php/sessions/ea-php73"
    php_value upload_max_filesize 512M
    php_flag zlib.output_compression On
    
    php_value default_socket_timeout 300
    php_flag display_errors Off
    php_value max_execution_time 90
    php_value max_input_time -1
    php_value max_input_vars 3000
    php_value memory_limit 512M
    php_value post_max_size 512M
    php_value session.gc_maxlifetime 1440
    php_value session.save_path "/var/cpanel/php/sessions/ea-php73"
    php_value upload_max_filesize 512M
    php_flag zlib.output_compression On
    
    # END cPanel-generated php ini directives, do not edit
    
    # php -- BEGIN cPanel-generated handler, do not edit
    # Set the “ea-php73” package as the default “PHP” programming language.
    
    AddHandler application/x-httpd-ea-php73 .php .php7 .phtml
    
    # php -- END cPanel-generated handler, do not edit
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.