Skip to content

Instantly share code, notes, and snippets.

@tobikris
Created June 8, 2014 21:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tobikris/d947e8ca63e64007d4f7 to your computer and use it in GitHub Desktop.
Save tobikris/d947e8ca63e64007d4f7 to your computer and use it in GitHub Desktop.
.htaccess Examples
AddDefaultCharset utf-8
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Mon, 1 Jan 2010 01:00:00 GMT"
RewriteEngine On
RewriteBase /service
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^\ ]+)\.php
RewriteRule ^/?(.*)\.php$ $1 [L,R=307,QSA]
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php [L,QSA]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment