janusnic/wee/master/public/.htaccess - Htaccess File

janusnic/wee/master/public/.htaccess

#------------------------------------
  # Maintenance
#------------------------------------

#RewriteCond %{REMOTE_ADDR} !^123.456.789.
#RewriteCond %{REQUEST_URI} !^/maintenance.html$
#RewriteCond $1 !^(assets) [NC]
#RewriteRule ^(.*)$ /maintenance.html [R=307,L]

#------------------------------------
  # Setup
#------------------------------------

RewriteEngine On
Options +FollowSymLinks -Indexes -MultiViews

# Internet Explorer document mode
Header set X-UA-Compatible "IE=edge"

# Character set
AddDefaultCharset utf-8
AddCharset utf-8 .atom .css .js .json .map .rss .xml

#------------------------------------
  # Remote Assets
#------------------------------------

# Cross-origin images
#<FilesMatch ".(bmp|cur|gif|ico|jpe?g|png|svgz?|webp)$">
#  SetEnvIf Origin ":" IS_CORS
#  Header set Access-Control-Allow-Origin "*" env=IS_CORS
#</FilesMatch>

# Cross-origin web fonts
#<FilesMatch ".(eot|otf|tt[cf]|woff2?)$">
#  Header set Access-Control-Allow-Origin "*"
#</FilesMatch>

#------------------------------------
  # Errors
#------------------------------------

ErrorDocument 404 /404.html

#------------------------------------
  # Project
#------------------------------------

# Custom redirects and rewrites

#------------------------------------
  # Rewrites
#------------------------------------

# Force www
#RewriteCond %{HTTP_HOST} !^www.weepower.com$ [NC]
#RewriteRule ^(.*)$ http://www.weepower.com/$1 [R=301,L]

# Remove www (don't use both force and remove)
#RewriteCond %{HTTP_HOST} ^www.weepower.com$ [NC]
#RewriteRule ^(.*)$ http://www.weepower.com/$1 [R=301,L]

# Force SSL
#RewriteCond %{HTTPS} !=on
#RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]

# Remove trailing slash
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [R=301,L]

# Remove multiple slashes
RewriteCond %{THE_REQUEST} //
RewriteRule ^(.*)$ /$1 [R=301,L]

# Remove index reference
RewriteCond %{REQUEST_URI} ^(.*/)index.html$ [NC]
RewriteRule . %1 [R=301,L]

# Remove extension
RewriteCond %{REQUEST_URI} ^GET (.*).html(.*) HTTP
RewriteRule (.*).html$ $1$2 [R=301]

# Rewrite extension
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule (.*) $1.html [L]

On Github License

Files

Download PDF of Htaccess file
GET, HTTP_HOST, HTTPS, REMOTE_ADDR, REQUEST_FILENAME, REQUEST_URI, THE_REQUEST

Comments

Apache