• I tryed changing where gzip is called in .htaccess caus e the planet hosters article sayd to put gzip and the cache headers at the top. Mine starts with wp rocket settings and i can’t put gzip either before at the top or after wp rocket noteven after wordpress or even after double htaccess oath is don at the bottom but it gives an error all the time no matter what you change. I even tryed to erase 2 blank lines between comments that where empty, i didn’t change no data and it served a 500 error just like when htaccess is tamperd with. Now i have a cloudflare firewall and ddos protection, plus css,html and js minification and async going with cloudflare and wp rocket and even have autoptimize for 7 files that the others won’t defer. All those caches including opcache and pagespeed are going.

    What is protecting htacess, i managed to change it before no i can’t anymore.

    # BEGIN WP Rocket v3.2.3.1
    # Use UTF-8 encoding for anything served text/plain or text/html
    AddDefaultCharset UTF-8
    # Force UTF-8 for a number of file formats
    <IfModule mod_mime.c>
    AddCharset UTF-8 .atom .css .js .json .rss .vtt .xml
    </IfModule>
    
    # FileETag None is not enough for every server.
    <IfModule mod_headers.c>
    Header unset ETag
    </IfModule>
    
    # Since we’re sending far-future expires, we don’t need ETags for static content.
    # developer.yahoo.com/performance/rules.html#etags
    FileETag None
    
    <IfModule mod_alias.c>
    <FilesMatch "\.(html|htm|rtf|rtx|txt|xsd|xsl|xml)$">
    <IfModule mod_headers.c>
    Header set X-Powered-By "WP Rocket/3.2.3.1"
    Header unset Pragma
    Header append Cache-Control "public"
    Header unset Last-Modified
    </IfModule>
    </FilesMatch>
    
    <FilesMatch "\.(css|htc|js|asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|json|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|otf|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|svg|svgz|swf|tar|tif|tiff|ttf|ttc|wav|wma|wri|xla|xls|xlsx|xlt|xlw|zip)$">
    <IfModule mod_headers.c>
    Header unset Pragma
    Header append Cache-Control "public"
    </IfModule>
    </FilesMatch>
    </IfModule>
    
    # Force deflate for mangled headers
    <IfModule mod_setenvif.c>
    <IfModule mod_headers.c>
    SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
    RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
    # Don’t compress images and other uncompressible content
    SetEnvIfNoCase Request_URI \
    \.(?:gif|jpe?g|png|rar|zip|exe|flv|mov|wma|mp3|avi|swf|mp?g|mp4|webm|webp|pdf)$ no-gzip dont-vary
    </IfModule>
    </IfModule>
    
    # Compress all output labeled with one of the following MIME-types
    <IfModule mod_filter.c>
    AddOutputFilterByType DEFLATE application/atom+xml \
    		                          application/javascript \
    		                          application/json \
    		                          application/rss+xml \
    		                          application/vnd.ms-fontobject \
    		                          application/x-font-ttf \
    		                          application/xhtml+xml \
    		                          application/xml \
    		                          font/opentype \
    		                          image/svg+xml \
    		                          image/x-icon \
    		                          text/css \
    		                          text/html \
    		                          text/plain \
    		                          text/x-component \
    		                          text/xml
    </IfModule>
    <IfModule mod_headers.c>
    Header append Vary: Accept-Encoding
    </IfModule>
    </IfModule>
    
    # END WP Rocket
    
    # PH pagespeed start
    <IfModule pagespeed_module>
    ModPagespeed on
    ModPagespeedRewriteLevel PassThrough
    ModPagespeedEnableFilters add_head,fallback_rewrite_css_urls,flatten_css_imports,rewrite_style_attributes_with_url,extend_cache,convert_meta_tags,combine_javascript,rewrite_javascript,inline_javascript,rewrite_css,combine_css,inline_css,inline_import_to_link,rewrite_images
    </IfModule>
    # PH pagespeed end
    #PH auth start
    ErrorDocument 401 default
    <FilesMatch "^((wp-login)\.php|(xmlrpc)\.php|(admin-ajax)\.php)$">
    AuthType Basic
    AuthUserFile /home/punkmmur/.htpasswd
    AuthName "Double Authentification PlanetHoster"
    require valid-user
    </FilesMatch>
    #PH auth end
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress
    
    #Expires cache end
    # BEGIN Cache-Control Headers
    <IfModule mod_expires.c>
      <IfModule mod_headers.c>
        <filesMatch "\.(ico|jpe?g|png|gif|swf)$">
          Header append Cache-Control "public"
        </filesMatch>
        <filesMatch "\.(css)$">
          Header append Cache-Control "public"
        </filesMatch>
        <filesMatch "\.(js)$">
          Header append Cache-Control "private"
        </filesMatch>
        <filesMatch "\.(x?html?|php)$">
          Header append Cache-Control "private, must-revalidate"
        </filesMatch>
      </IfModule>
    </IfModule>
    # Disable ETags
    <IfModule mod_headers.c>
    	Header unset ETag
    </IfModule>
    FileETag None
    php_value upload_max_filesize 200M
    php_value post_max_size 200M
    
    # Gzip compression
    FileETag MTime Size
    # Gzip compression
    # Active compression
    SetOutputFilter DEFLATE
    #Activation du Mod Deflate
    #Activation du Mod Deflate
    <IfModule mod_deflate.c>
    # Compresse les fichiers HTML, CSS, JavaScript, Text, XML et les 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
    # Ce code est pour assurer une compatibilité avec les anciens navigateurs
    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
    </IfModule>
    
    #Activation du mod Expires
    #Customize expires cache start - adjust the period according to your needs
    
    # Expires headers (for better cache control)
      #Activation du mod Expires
    	#Customize expires cache start - adjust the period according to your needs
    
    	# Expires headers (for better cache control)
    	<IfModule mod_expires.c>
    	  FileETag MTime Size
    	  ExpiresActive on
    		# Perhaps better to whitelist expires rules? Perhaps.
    		ExpiresDefault                              "access plus 1 month"
    		# cache.appcache needs re-requests in FF 3.6 (thanks Remy ~Introducing HTML5)
    		ExpiresByType text/cache-manifest           "access plus 1 month"
    		# Your document html
    		ExpiresByType text/html                     "access plus 1 month"
    		# Data
    		ExpiresByType text/xml                      "access plus 1 month"
    		ExpiresByType application/xml               "access plus 1 month"
    		ExpiresByType application/json              "access plus 1 month"
    		# Feed
    		ExpiresByType application/rss+xml           "access plus 1 hour"
    		ExpiresByType application/atom+xml          "access plus 1 hour"
    		# Favicon (cannot be renamed)
    		ExpiresByType image/x-icon                  "access plus 1 week"
    		# Media: images, video, audio
    		ExpiresByType image/gif                     "access plus 1 year"
    		ExpiresByType image/png                     "access plus 1 year"
    		ExpiresByType image/jpeg                    "access plus 1 year"
    		ExpiresByType image/webp                    "access plus 1 year"
    		ExpiresByType video/ogg                     "access plus 1 year"
    		ExpiresByType audio/ogg                     "access plus 1 year"
    		ExpiresByType video/mp4                     "access plus 1 year"
    		ExpiresByType video/webm                    "access plus 1 year"
    		# HTC files  (css3pie)
    		ExpiresByType text/x-component              "access plus 1 month"
    		# Webfonts
    		ExpiresByType application/x-font-ttf        "access plus 1 year"
    		ExpiresByType font/opentype                 "access plus 1 year"
    		ExpiresByType application/x-font-woff       "access plus 1 year"
    		ExpiresByType application/x-font-woff2      "access plus 1 year"
    		ExpiresByType image/svg+xml                 "access plus 1 year"
    		ExpiresByType application/vnd.ms-fontobject "access plus 1 year"
    		# CSS and JavaScript
    		ExpiresByType text/css                      "access plus 1 month"
    	  ExpiresByType text/javascript               "access plus 1 month"
    		ExpiresByType application/javascript        "access plus 1 month"
    		# Others
    		ExpiresByType application/pdf "access plus 1 month"
    		ExpiresByType application/x-shockwave-flash "access plus 1 month"
    	</IfModule>
    
    # BEGIN ShortPixelWebp
    
    # END ShortPixelWebp
    

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • You might try using one of the htaccess file testers such as https://htaccess.madewithlove.be/

    I’ve not used the above and can’t vouch or endorse it but as complex as your htacess file is I’d recommend using something to ‘lean on’.

    My other thought is to print the whole file out and underline, red pen notes, margin notes, and highlight it well.

    And I’m sure you know this but be careful with your editor and the upload download format if you’re using a FTP client to edit offline.

    A Google search might turn up more htaccess tools to help you and test changes or ideas.

Viewing 1 replies (of 1 total)
  • The topic ‘Cannot change nothing in .htaccess file without server error 500 contact webmast’ is closed to new replies.