Skip to content

Instantly share code, notes, and snippets.

View Jamiewarb's full-sized avatar
🦑

Jamie Warburton Jamiewarb

🦑
View GitHub Profile
@Jamiewarb
Jamiewarb / .htaccess
Last active June 16, 2017 08:48
Maintenance page using .htaccess
# Maintenance page
RewriteCond %{REMOTE_ADDR} !^000\.000\.000\.000
RewriteCond %{REQUEST_URI} !^/maintenance\.php$
# Allow a specific requ
RewriteCond %{REQUEST_URI} !^/company-logo.png$ [NC]
# Allow a series of filetypes
RewriteCond %{REQUEST_URI} !\.(css|jpe?g?|png|gif|woff|ttf) [NC]
RewriteRule ^(.*)$ https://www.domain.com/maintenance.php [R=307,L]
@Jamiewarb
Jamiewarb / .htaccess
Created April 26, 2017 10:03
Remove file extension with .htaccess
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php