# BEGIN WpFastestCache
# Modified Time: 19-05-25 18:45:20
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} =on
RewriteCond %{HTTP_HOST} ^www.newedgeexteriors.com
# Start WPFC Exclude
# End WPFC Exclude
# Start_WPFC_Exclude_Admin_Cookie
RewriteCond %{HTTP:Cookie} !wordpress_logged_in_[^\=]+\=bwadmin|dpadmin
# End_WPFC_Exclude_Admin_Cookie
RewriteCond %{HTTP_HOST} ^www.newedgeexteriors.com
RewriteCond %{HTTP_USER_AGENT} !(facebookexternalhit|WP_FASTEST_CACHE_CSS_VALIDATOR|Twitterbot|LinkedInBot|WhatsApp|Mediatoolkitbot)
RewriteCond %{HTTP_USER_AGENT} !(WP\sFastest\sCache\sPreload(\siPhone\sMobile)?\s*Bot)
RewriteCond %{REQUEST_METHOD} !POST
RewriteCond %{REQUEST_URI} !(\/){2,}
RewriteCond %{THE_REQUEST} !(\/){2,}
RewriteCond %{REQUEST_URI} \/$
RewriteCond %{QUERY_STRING} !.+ [OR]
RewriteCond %{QUERY_STRING} fbclid=
RewriteCond %{HTTP:Cookie} !wordpress_logged_in
RewriteCond %{HTTP:Cookie} !comment_author_
RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/all/$1/index.html -f [or]
RewriteCond /home/newedge/public_html/wp-content/cache/all/$1/index.html -f
RewriteRule ^(.*) "/wp-content/cache/all/$1/index.html" [L]
</IfModule>
<FilesMatch "index\.(html|htm)$">
AddDefaultCharset UTF-8
<ifModule mod_headers.c>
FileETag None
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Mon, 29 Oct 1923 20:30:00 GMT"
</ifModule>
</FilesMatch>
# END WpFastestCache


#==================================
# Apache Server Configs
# v3.0.31-bw-d | 2024-12-05
# https://www.brettworks.net
#==================================

# ----------------------------------------------------------------------
# | Force `https://www
# ----------------------------------------------------------------------

<IfModule mod_rewrite.c>
	RewriteEngine on

	RewriteCond %{HTTPS} !on
	RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

	RewriteCond %{HTTP_HOST} !^www\. [NC]
	RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

	#If using cloudflare
	#RewriteCond %{HTTP:X-Forwarded-Proto} =http
	#RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>

# ----------------------------------------------------------------------
# | Force trailing slash
# ----------------------------------------------------------------------

#No slash
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^(.*)/$ /$1 [L,R]
#Keep slash
#RewriteCond %{REQUEST_URI} /+[^\.]+$
#RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [R=301,L]

# ----------------------------------------------------------------------
# | HTTP Strict Transport Security (HSTS)
# | DO NOT ENABLE THIS UNLESS YOU KNOW WHAT YOU'RE DOING
# ----------------------------------------------------------------------

# Force client-side SSL redirection.

# (!) Remove the `includeSubDomains` optional directive if the website's
# subdomains are not using HTTPS.

# <IfModule mod_headers.c>
#     Header always set Strict-Transport-Security "max-age=16070400"
#     OR (use above line OR below line, NOT BOTH)
#     Header always set Strict-Transport-Security "max-age=16070400; includeSubDomains"
# </IfModule>

# ----------------------------------------------------------------------
# | Custom Site Redirects
# | ADD CUSTOM REDIRECTS IN THIS SECTION
# ----------------------------------------------------------------------

<IfModule mod_rewrite.c>

	RewriteEngine on

	# If old path is /old-path OR /old-path/, use ^old-path/?$ as follows:
	# RedirectMatch 301 ^/old-path/?$ https://www.example.tld/new-location/







</IfModule>

# ----------------------------------------------------------------------
# |
# |
# | *END USER CUSTOMIZATIONS*
# | *Please don't change anything below*
# |
# |
# ----------------------------------------------------------------------


# ----------------------------------------------------------------------
# | X-Frame-Options - prevent site from being framed elsewhere
# ----------------------------------------------------------------------

<ifModule mod_headers.c>
	Header always set X-Frame-Options "sameorigin"
</ifModule>



# ----------------------------------------------------------------------
# | Cross-origin images
# ----------------------------------------------------------------------

# Send the CORS header for images when browsers request it.

<IfModule mod_setenvif.c>
    <IfModule mod_headers.c>
        <FilesMatch "\.(bmp|cur|gif|ico|jpe?g|png|svgz?|webp)$">
            SetEnvIf Origin ":" IS_CORS
            Header set Access-Control-Allow-Origin "*" env=IS_CORS
        </FilesMatch>
    </IfModule>
</IfModule>

# ----------------------------------------------------------------------
# | Cross-origin web fonts
# ----------------------------------------------------------------------

# Allow cross-origin access to web fonts.

<IfModule mod_headers.c>
    <FilesMatch "\.(eot|otf|tt[cf]|woff2?)$">
        Header set Access-Control-Allow-Origin "*"
    </FilesMatch>
</IfModule>

# ----------------------------------------------------------------------
# | Custom error messages/pages
# ----------------------------------------------------------------------

ErrorDocument 400 /400.html
ErrorDocument 401 /401.html
ErrorDocument 403 /403.html
ErrorDocument 404 /404.html
ErrorDocument 500 /500.html
ErrorDocument 503 /503.html
ErrorDocument 508 /508.html
#ErrorDocument 509 /509.html

# ----------------------------------------------------------------------
# | Error prevention
# ----------------------------------------------------------------------

# Disable the pattern matching based on filenames.
# This setting prevents Apache from returning a 404 error as the result
# of a rewrite when the directory with the same name does not exist.

Options -MultiViews

# ----------------------------------------------------------------------
# | Document modes
# ----------------------------------------------------------------------

# Force Internet Explorer 8/9/10 to render pages in the highest mode
# available in the various cases when it may not.

<IfModule mod_headers.c>

    Header set X-UA-Compatible "IE=edge"

    # `mod_headers` cannot match based on the content-type, however,
    # the `X-UA-Compatible` response header should be send only for
    # HTML documents and not for the other resources.

    <FilesMatch "\.(appcache|atom|bbaw|bmp|br|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|gz|htc|ic[os]|jpe?g|m?js|json(ld)?|m4[av]|manifest|map|markdown|md|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|wasm|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
        Header unset X-UA-Compatible
    </FilesMatch>

</IfModule>

# ----------------------------------------------------------------------
# | Media types
# ----------------------------------------------------------------------

# Serve resources with the proper media types (f.k.a. MIME types).

<IfModule mod_mime.c>

  # Data interchange
    AddType application/atom+xml                        atom
    AddType application/json                            json map topojson
    AddType application/ld+json                         jsonld
    AddType application/rss+xml                         rss
    AddType application/vnd.geo+json                    geojson
    AddType application/xml                             rdf xml

  # JavaScript
    # Servers should use text/javascript for JavaScript resources.
    # https://html.spec.whatwg.org/multipage/scripting.html#scriptingLanguages
    AddType text/javascript                             js mjs

  # Manifest files
    AddType application/manifest+json                   webmanifest
    AddType application/x-web-app-manifest+json         webapp
    AddType text/cache-manifest                         appcache

  # Media files
    AddType audio/mp4                                   f4a f4b m4a
    AddType audio/ogg                                   oga ogg opus
    AddType image/bmp                                   bmp
    AddType image/svg+xml                               svg svgz
    AddType image/webp                                  webp
    AddType video/mp4                                   f4v f4p m4v mp4
    AddType video/ogg                                   ogv
    AddType video/webm                                  webm
    AddType video/x-flv                                 flv

    # Serving `.ico` image files with a different media type
    # prevents Internet Explorer from displaying them as images:
    # https://github.com/h5bp/html5-boilerplate/commit/37b5fec090d00f38de64b591bcddcb205aadf8ee
    AddType image/x-icon                                cur ico

  # WebAssembly
    AddType application/wasm                            wasm

  # Web fonts
    AddType font/woff                                   woff
    AddType font/woff2                                  woff2
    AddType application/vnd.ms-fontobject               eot
    AddType font/ttf                                    ttf
    AddType font/collection                             ttc
    AddType font/otf                                    otf

  # Other
    AddType application/octet-stream                    safariextz
    AddType application/x-bb-appworld                   bbaw
    AddType application/x-chrome-extension              crx
    AddType application/x-opera-extension               oex
    AddType application/x-xpinstall                     xpi
    AddType text/calendar                               ics
    AddType text/markdown                               markdown md
    AddType text/vcard                                  vcard vcf
    AddType text/vnd.rim.location.xloc                  xloc
    AddType text/vtt                                    vtt
    AddType text/x-component                            htc

</IfModule>

# ----------------------------------------------------------------------
# | Character encodings
# ----------------------------------------------------------------------

AddDefaultCharset utf-8

<IfModule mod_mime.c>
    AddCharset utf-8 .atom \
                     .bbaw \
                     .css \
                     .geojson \
                     .ics \
                     .js \
                     .json \
                     .jsonld \
                     .manifest \
                     .markdown \
                     .md \
                     .mjs \
                     .rdf \
                     .rss \
                     .topojson \
                     .vtt \
                     .webapp \
                     .webmanifest \
                     .xloc \
                     .xml
</IfModule>

# ----------------------------------------------------------------------
# | Rewrite engine
# ----------------------------------------------------------------------

<IfModule mod_rewrite.c>
    RewriteEngine On
    Options +FollowSymlinks
    RewriteCond %{HTTPS} =on
    RewriteRule ^ - [env=proto:https]
    RewriteCond %{HTTPS} !=on
    RewriteRule ^ - [env=proto:http]
</IfModule>

# ----------------------------------------------------------------------
# | File access
# ----------------------------------------------------------------------

<IfModule mod_autoindex.c>
    Options -Indexes
</IfModule>

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_URI} "!(^|/)\.well-known/([^./]+./?)+$" [NC]
    RewriteCond %{SCRIPT_FILENAME} -d [OR]
    RewriteCond %{SCRIPT_FILENAME} -f
    RewriteRule "(^|/)\." - [F]
</IfModule>

<FilesMatch "(^#.*#|\.(old|def|orig|bpk|bad|bk|bak|conf|dist|fla|in[ci]|log|psd|sh|sql|sw[op])|~)$">

    # Apache < 2.3
    <IfModule !mod_authz_core.c>
        Order allow,deny
        Deny from all
        Satisfy All
    </IfModule>

    # Apache = 2.3
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>

</FilesMatch>

# ----------------------------------------------------------------------
# | Reducing MIME type security risks
# ----------------------------------------------------------------------

<IfModule mod_headers.c>
    Header set X-Content-Type-Options "nosniff"
</IfModule>

# ----------------------------------------------------------------------
# | Reflected Cross-Site Scripting (XSS) attacks
# ----------------------------------------------------------------------

<IfModule mod_headers.c>

    Header set X-XSS-Protection "1; mode=block"

   <FilesMatch "\.(appcache|atom|bbaw|bmp|br|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|gz|htc|ic[os]|jpe?g|m?js|json(ld)?|m4[av]|manifest|map|markdown|md|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|wasm|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
	Header unset X-XSS-Protection
   </FilesMatch>

</IfModule>

# ----------------------------------------------------------------------
# | Server-side technology information
# ----------------------------------------------------------------------

<IfModule mod_headers.c>
    Header unset X-Powered-By
</IfModule>

# ----------------------------------------------------------------------
# | Server software information
# ----------------------------------------------------------------------

ServerSignature Off

# ----------------------------------------------------------------------
# | Compression
# ----------------------------------------------------------------------

<IfModule mod_deflate.c>

	# Force compression for mangled `Accept-Encoding` request 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
		</IfModule>
	</IfModule>

	# Compress all output labeled with one of the following media types.

	    <IfModule mod_filter.c>
		AddOutputFilterByType DEFLATE "application/atom+xml" \
					      "application/javascript" \
					      "application/json" \
					      "application/ld+json" \
					      "application/manifest+json" \
					      "application/rdf+xml" \
					      "application/rss+xml" \
					      "application/schema+json" \
					      "application/vnd.geo+json" \
					      "application/vnd.ms-fontobject" \
					      "application/wasm" \
					      "application/x-font-ttf" \
					      "application/x-javascript" \
					      "application/x-web-app-manifest+json" \
					      "application/xhtml+xml" \
					      "application/xml" \
					      "font/collection" \
					      "font/eot" \
					      "font/opentype" \
					      "font/otf" \
					      "font/ttf" \
					      "image/bmp" \
					      "image/svg+xml" \
					      "image/vnd.microsoft.icon" \
					      "image/x-icon" \
					      "text/cache-manifest" \
					      "text/calendar" \
					      "text/css" \
					      "text/html" \
					      "text/javascript" \
					      "text/plain" \
					      "text/markdown" \
					      "text/vcard" \
					      "text/vnd.rim.location.xloc" \
					      "text/vtt" \
					      "text/x-component" \
					      "text/x-cross-domain-policy" \
					      "text/xml"

	    </IfModule>

	# Map the following filename extensions to the specified
	# encoding type in order to make Apache serve the file types
	# with the appropriate `Content-Encoding` response header

	<IfModule mod_mime.c>
	AddEncoding gzip              svgz
	</IfModule>

</IfModule>

# ----------------------------------------------------------------------
# | ETags
# ----------------------------------------------------------------------

<IfModule mod_headers.c>
    Header unset ETag
</IfModule>

FileETag None

# ----------------------------------------------------------------------
# | Browser Caching / Expires Headers
# ----------------------------------------------------------------------

# Serve resources with far-future expires headers.

<IfModule mod_expires.c>

    ExpiresActive on
    ExpiresDefault                                      "access plus 1 month"

  # CSS
    ExpiresByType text/css                              "access plus 1 month"

  # Data interchange
    ExpiresByType application/atom+xml                  "access plus 1 hour"
    ExpiresByType application/rdf+xml                   "access plus 1 hour"
    ExpiresByType application/rss+xml                   "access plus 1 hour"

    ExpiresByType application/json                      "access plus 0 seconds"
    ExpiresByType application/ld+json                   "access plus 0 seconds"
    ExpiresByType application/schema+json               "access plus 0 seconds"
    ExpiresByType application/vnd.geo+json              "access plus 0 seconds"
    ExpiresByType application/xml                       "access plus 0 seconds"
    ExpiresByType text/calendar                         "access plus 0 seconds"
    ExpiresByType text/xml                              "access plus 0 seconds"

  # Favicon (cannot be renamed!) and cursor images
    ExpiresByType image/vnd.microsoft.icon              "access plus 1 week"
    ExpiresByType image/x-icon                          "access plus 1 week"

  # HTML
    ExpiresByType text/html                             "access plus 0 seconds"

  # JavaScript
    ExpiresByType application/javascript                "access plus 1 month"
    ExpiresByType application/x-javascript              "access plus 1 month"
    ExpiresByType text/javascript                       "access plus 1 month"

  # Manifest files
    ExpiresByType application/manifest+json             "access plus 1 week"
    ExpiresByType application/x-web-app-manifest+json   "access plus 0 seconds"
    ExpiresByType text/cache-manifest                   "access plus 0 seconds"

  # Markdown
    ExpiresByType text/markdown                         "access plus 0 seconds"

  # Media files
    ExpiresByType audio/ogg                             "access plus 1 month"
    ExpiresByType image/bmp                             "access plus 1 month"
    ExpiresByType image/gif                             "access plus 1 month"
    ExpiresByType image/jpeg                            "access plus 1 month"
    ExpiresByType image/png                             "access plus 1 month"
    ExpiresByType image/svg+xml                         "access plus 1 month"
    ExpiresByType image/webp                            "access plus 1 month"
    ExpiresByType video/mp4                             "access plus 1 month"
    ExpiresByType video/ogg                             "access plus 1 month"
    ExpiresByType video/webm                            "access plus 1 month"

  # WebAssembly
    ExpiresByType application/wasm                      "access plus 1 month"

  # Web fonts

	    # Collection
	    ExpiresByType font/collection                       "access plus 1 month"

	    # Embedded OpenType (EOT)
	    ExpiresByType application/vnd.ms-fontobject         "access plus 1 month"
	    ExpiresByType font/eot                              "access plus 1 month"

	    # OpenType
	    ExpiresByType font/opentype                         "access plus 1 month"
	    ExpiresByType font/otf                              "access plus 1 month"

	    # TrueType
	    ExpiresByType application/x-font-ttf                "access plus 1 month"
	    ExpiresByType font/ttf                              "access plus 1 month"

	    # Web Open Font Format (WOFF) 1.0
	    ExpiresByType application/font-woff                 "access plus 1 month"
	    ExpiresByType application/x-font-woff               "access plus 1 month"
	    ExpiresByType font/woff                             "access plus 1 month"

	    # Web Open Font Format (WOFF) 2.0
	    ExpiresByType application/font-woff2                "access plus 1 month"
	    ExpiresByType font/woff2                            "access plus 1 month"

  # Other
    ExpiresByType text/x-cross-domain-policy            "access plus 1 week"

</IfModule>

# ----------------------------------------------------------------------
# | File concatenation
# ----------------------------------------------------------------------

# Allow concatenation from within specific files.

#       <!--#include file="js/jquery.js" -->
#       <!--#include file="js/jquery.timer.js" -->

<IfModule mod_include.c>
    <FilesMatch "\.combined\.js$">
        Options +Includes
        AddOutputFilterByType INCLUDES application/javascript \
                                       application/x-javascript \
                                       text/javascript
        SetOutputFilter INCLUDES
    </FilesMatch>
    <FilesMatch "\.combined\.css$">
        Options +Includes
        AddOutputFilterByType INCLUDES text/css
        SetOutputFilter INCLUDES
    </FilesMatch>
</IfModule>

# ----------------------------------------------------------------------
# | Filename-based cache busting
# ----------------------------------------------------------------------

# Route all requests such as `/style.12345.css` to `/style.css`.

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.+)\.(\d+)\.(bmp|css|cur|gif|ico|jpe?g|js|png|svgz?|webp|webmanifest)$ $1.$3 [L]
</IfModule>

# ----------------------------------------------------------------------
# | Persistent connections
# ----------------------------------------------------------------------

 <IfModule mod_headers.c>
 Header set Connection Keep-Alive
 </IfModule>

# ----------------------------------------------------------------------
# | Misc Tweaks | KEEP THIS SECTION ABOVE CMS REDIRECTS
# ----------------------------------------------------------------------

# Prevent missing -files- from making CMS generate a 404 page

<IfModule mod_rewrite.c>
	RewriteEngine On

	# Exclude /sitemap.xml from the rule
	RewriteCond %{REQUEST_URI} (sitemap.*\.xml|robots.*\.txt)$ [NC]
	RewriteRule .* /index.php [L]

	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteRule \.(jpg|jpeg|png|gif|ico|swf|svg|bmp|css|js|ttf|woff2|txt|xml|php|zip)$ - [NC,redirect=404,L]
</IfModule>

# Prevent improper public Windows Domain traffic from generating CMS 404s

Redirect 404 /sysvol
Redirect 404 /Sysvol
Redirect 404 /SysVol
Redirect 404 /SYSVOL

# ----------------------------------------------------------------------
# | Misc Protections
# ----------------------------------------------------------------------

# Protect .htaccess

<Files .htaccess>
	order allow,deny
	deny from all
</Files>

<Files ~ “^.*\.([Hh][Tt][Aa])”>
    order allow,deny
    deny from all
    satisfy all
</files>

# Protect from SQL injection

<IfModule mod_rewrite.c>
    Options +FollowSymLinks
    RewriteEngine On
    RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
    RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
    RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
    RewriteRule ^(.*)$ index.php [F,L]
</IfModule>

# ----------------------------------------------------------------------
# | Wordpress Rewrite and Protections
# ----------------------------------------------------------------------

# Block xmlrpc.php access

<Files "xmlrpc.php">
	Order Allow,Deny
	deny from all
</Files>

# Protect wp-config.php

<files wp-config.php>
	Order deny,allow
	Deny from all
</files>

# Prevent search engines from indexing threaded (and non cacheable) comments. Redirects to original page without using PHP.

<IfModule mod_rewrite.c>
	RewriteEngine On
	RewriteCond %{HTTP_USER_AGENT} "Baiduspider|bingbot|Exabot|Ezooms|Googlebot|MJ12bot|msnbot|naver.com|ScoutJet|Slurp|YandexBot"
	RewriteCond %{QUERY_STRING} ^replytocom=\d+$
	RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI}? [R=301,L]
</IfModule>

# Block WP include-only files

<IfModule mod_rewrite.c>
	RewriteEngine On
	RewriteBase /
	RewriteRule ^wp-admin/includes/ - [F,L]
	RewriteRule !^wp-includes/ - [S=3]
	RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]
	RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]
	RewriteRule ^wp-includes/theme-compat/ - [F,L]
</IfModule>

# Normal Wordpress Rewrite

# 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.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php81” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php81 .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
