Skip to content

Instantly share code, notes, and snippets.

@akamola

akamola/.htaccess

Created May 31, 2013
Embed
What would you like to do?
HTACCESS: Basic configuration for web projects for Apache web servers
# PHP
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 ^(.*) http://example.com/$1 [L,R]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment