Created
May 31, 2013 08:34
-
-
Save akamola/5683621 to your computer and use it in GitHub Desktop.
HTACCESS: Basic configuration for web projects for Apache web servers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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