Skip to content

Instantly share code, notes, and snippets.

@codebymark
Created November 6, 2018 21:58

Revisions

  1. codebymark created this gist Nov 6, 2018.
    24 changes: 24 additions & 0 deletions .htaccess
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    # A collection of handy features
    # Mark Bucknell <markbucknellcc@gmail.com>

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    # IP address block/redirect
    # If your ip address is not in this list then redirect to the maintenance page
    #Options +FollowSymlinks
    #RewriteCond %{REMOTE_HOST} !^1.2.3.4 # Additional IP added by |<ip address here>
    #RewriteCond %{REQUEST_URI} !=/maintenance/logo.svg
    #RewriteCond %{REQUEST_URI} !=/maintenance/style.css
    #RewriteRule ^(.*)$ /maintenance/index.php [R=302,L] #302 for temporary redirect

    # Force HTTPS and WWW
    #RewriteCond %{HTTPS} off [OR]
    #RewriteCond %{HTTP_HOST} !^www\.website\.com$ [NC]
    #RewriteRule ^(.*)$ https://www.website.com/$1 [L,R=301]
    </IfModule>

    <IfModule !mod_rewrite.c>
    ErrorDocument 404 /index.php
    </IfModule>