2010-12-20 15:41:01 +00:00
|
|
|
# Custom error pages for php scripts only
|
|
|
|
<FilesMatch \.php$>
|
|
|
|
ErrorDocument 400 /error.php?400
|
|
|
|
ErrorDocument 401 /error.php?401
|
|
|
|
ErrorDocument 403 /error.php?403
|
|
|
|
ErrorDocument 404 /error.php?404
|
|
|
|
ErrorDocument 500 /error.php?500
|
|
|
|
</FilesMatch>
|
|
|
|
|
2013-02-05 11:07:57 -08:00
|
|
|
### Performance
|
|
|
|
AddDefaultCharset utf-8
|
|
|
|
|
|
|
|
### Security
|
|
|
|
ServerSignature Off
|
|
|
|
|
2013-01-31 14:31:57 -08:00
|
|
|
# secure htaccess file
|
|
|
|
<Files .htaccess>
|
2013-02-05 11:07:57 -08:00
|
|
|
order allow,deny
|
|
|
|
deny from all
|
2013-01-31 14:31:57 -08:00
|
|
|
</Files>
|
|
|
|
|
|
|
|
# protect e107_config.php
|
|
|
|
<Files e107_config.php>
|
2013-02-05 11:07:57 -08:00
|
|
|
order allow,deny
|
|
|
|
deny from all
|
2013-01-31 14:31:57 -08:00
|
|
|
</Files>
|
|
|
|
|
|
|
|
|
2013-02-05 11:07:57 -08:00
|
|
|
### Block Bad Bots
|
|
|
|
SetEnvIfNoCase ^User-Agent$ .*(craftbot|download|extract|stripper|sucker|ninja|clshttp|webspider|leacher|collector|grabber|webpictures) HTTP_SAFE_BADBOT
|
|
|
|
SetEnvIfNoCase ^User-Agent$ .*(libwww-perl|aesop_com_spiderman) HTTP_SAFE_BADBOT
|
|
|
|
Deny from env=HTTP_SAFE_BADBOT
|
2013-01-31 14:31:57 -08:00
|
|
|
|
2013-02-05 11:07:57 -08:00
|
|
|
### Disable directory listing
|
|
|
|
Options All -Indexes
|
2013-01-31 14:31:57 -08:00
|
|
|
|
2013-02-05 11:07:57 -08:00
|
|
|
### limit file uploads to 10mb
|
|
|
|
### LimitRequestBody 10240000
|
2013-01-31 14:31:57 -08:00
|
|
|
|
2008-12-03 20:57:22 +00:00
|
|
|
<IfModule mod_rewrite.c>
|
2009-09-13 16:37:18 +00:00
|
|
|
### enable rewrites
|
|
|
|
Options +FollowSymLinks
|
|
|
|
RewriteEngine On
|
2008-12-02 23:44:19 +00:00
|
|
|
|
2013-02-05 11:07:57 -08:00
|
|
|
|
2009-09-14 18:22:16 +00:00
|
|
|
### Set this to your e107 site root, path relative to web root
|
2011-12-10 00:08:51 +00:00
|
|
|
### Uncomment it in case your server isn't able to rewrite proper
|
|
|
|
#RewriteBase /
|
2013-02-05 11:07:57 -08:00
|
|
|
|
|
|
|
### Allow only GET and POST methods
|
|
|
|
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK|OPTIONS|HEAD)
|
|
|
|
RewriteRule .* - [F]
|
2008-12-02 23:44:19 +00:00
|
|
|
|
2009-09-13 16:37:18 +00:00
|
|
|
### send 404 on missing files in these folders
|
|
|
|
RewriteCond %{REQUEST_URI} !^/(e107_images|e107_files)/
|
|
|
|
|
|
|
|
### don't rewrite for existing files, directories and links
|
|
|
|
RewriteCond %{REQUEST_FILENAME} !-f
|
|
|
|
RewriteCond %{REQUEST_FILENAME} !-d
|
|
|
|
RewriteCond %{REQUEST_FILENAME} !-l
|
|
|
|
|
2011-11-25 17:58:03 +00:00
|
|
|
### Single entry point ###
|
2011-12-01 22:08:23 +00:00
|
|
|
RewriteRule .* index.php [L]
|
2009-09-13 16:37:18 +00:00
|
|
|
|
2008-12-03 20:57:22 +00:00
|
|
|
</IfModule>
|