JSFiddle - React, Tailwind, and code Playground

Basic .htaccess

by Jennifer Perrin

HTML

<pre>
RewriteEngine On

# Remove www.
&lt;IfModule mod_rewrite.c&gt;
    RewriteCond %{HTTPS} !=on
    RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
    RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
&lt;/IfModule&gt;

# Expires caching (Caching static files for longer drastically improves performance, you might even want to put even more aggressive times)
&lt;IfModule mod_expires.c&gt;
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
&lt;/IfModule&gt;

# Gzip 
&lt;ifmodule mod_deflate.c&gt;
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
&lt;/ifmodule&gt;

# 404 Page
ErrorDocument 404 /404.html

# Remove file extensions
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.html [NC,L]

# Force UTF-8
AddDefaultCharset utf-8
</pre>