Skip to content

Instantly share code, notes, and snippets.



Created May 31, 2013
What would you like to do?
HTACCESS: Basic configuration for web projects for Apache web servers
php_flag register_globals off
php_flag short_open_tag off
# Set default charset to UTF-8
AddDefaultCharset UTF-8
# File types
AddType text/vcard .vcf .vcard
AddType text/xml .rss
# Directory settings
## Set directory index
DirectoryIndex index.php index.html index.htm
## Hide index
Options -Indexes
# Rewrite
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
## Remove WWW prefix
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
RewriteRule ^(.*)$1 [L,R]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment