Skip to content

Instantly share code, notes, and snippets.

@sergeifilippov
Created March 24, 2013 22:05
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 sergeifilippov/5233757 to your computer and use it in GitHub Desktop.
Save sergeifilippov/5233757 to your computer and use it in GitHub Desktop.
.htaccess file merged in to httpd.conf reference: http://www.eschrade.com/page/no-htaccess-httpd-conf-file-for-magento
<VirtualHost *:80>
ServerName magento.loc
DocumentRoot /var/www/html
DirectoryIndex index.php
<Directory /var/www/html/var/>
Order deny,allow
Deny from all
</Directory>
<Directory /var/www/html/>
AllowOverride None
<IfModule mod_php5.c>
php_value memory_limit 128M
php_value max_execution_time 18000
php_flag magic_quotes_gpc off
php_flag session.auto_start off
</IfModule>
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
<IfModule mod_ssl.c>
SSLOptions StdEnvVars
</IfModule>
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
#RewriteBase /magento/
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule .* index.php [L]
</IfModule>
AddDefaultCharset Off
#AddDefaultCharset UTF-8
<IfModule mod_expires.c>
ExpiresDefault "access plus 1 year"
</IfModule>
Order allow,deny
Allow from all
</Directory>
<Directory /var/www/html/includes/>
Order deny,allow
Deny from all
</Directory>
<Directory /var/www/html/errors/>
<FilesMatch "\.(xml|phtml)$">
Deny from all
</FilesMatch>
</Directory>
<Directory /var/www/html/pkginfo/>
Order deny,allow
Deny from all
</Directory>
<Directory /var/www/html/app/>
Order deny,allow
Deny from all
</Directory>
<Directory /var/www/html/lib/>
Order deny,allow
Deny from all
</Directory>
<Directory /var/www/html/downloader/>
<IfModule mod_deflate.c>
RemoveOutputFilter DEFLATE
RemoveOutputFilter GZIP
</IfModule>
<Files ~ "\.(cfg|ini|xml)$">
order allow,deny
deny from all
</Files>
</Directory>
<Directory /var/www/html/downloader/template/>
Order deny,allow
Deny from all
</Directory>
<Directory /var/www/html/media/>
Options All -Indexes
<IfModule mod_php5.c>
php_flag engine 0
</IfModule>
AddHandler cgi-script .php .pl .py .jsp .asp .htm .shtml .sh .cgi
Options -ExecCGI
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* ../get.php [L]
</IfModule
</Directory>
<Directory /var/www/html/media/customer/>
Order deny,allow
Deny from all
</Directory>
<Directory /var/www/html/media/downloadable/>
Order deny,allow
Deny from all
</Directory>
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment