4630
by vain
- minor changes (comments etc) |
1 |
# .htaccess-template for Clansuite |
2 |
# |
|
3 |
# Apache Configuration File |
|
4 |
# httpd.apache.org/docs/2.2/mod/quickreference.html |
|
5 |
# |
|
6 |
# SVN: $Id: htaccess-full.txt 5284 2011-05-12 00:20:57Z vain $ |
|
3966
by vain
- added extra htaccess without comments (you might just rename that to .htaccess) |
7 |
|
8 |
# (1) Rename "htaccess.txt" to ".htaccess" |
|
9 |
# (2) If you don't need htaccess, then DELETE IT. It just slow's down Webserver processing. |
|
10 |
# (3) Redirect all Requests to the domain (http://www.domain.xy) to index.php |
|
11 |
||
12 |
DirectoryIndex index.php |
|
13 |
||
14 |
# Allow Symlinks |
|
15 |
Options +FollowSymLinks |
|
16 |
||
17 |
# Disallow Index-Listings |
|
18 |
Options -Indexes |
|
19 |
||
20 |
# (4) General and PHP.ini Settings |
|
21 |
SetEnv TZ Europe/Berlin |
|
22 |
<IfModule mod_php5.c> |
|
23 |
php_value magic_quotes_runtime "0" |
|
24 |
php_value magic_quotes_gpc "0" |
|
25 |
php_value register_globals "Off" |
|
26 |
php_value output_buffering "1" |
|
27 |
php_value output_handler ob_gzhandler |
|
4303
by vain
- xdebug settings added to htaccess |
28 |
|
29 |
# XDebug Remote Debugger |
|
30 |
php_value xdebug.remote_enable "On" |
|
31 |
php_value xdebug.remote_host "localhost" |
|
32 |
php_value xdebug.remote_port "9000" |
|
33 |
php_value xdebug.remote_handler "dbgp" |
|
34 |
||
35 |
# XDebug Profiler |
|
36 |
#php_value xdebug.profiler_enable "1" |
|
37 |
#php_value xdebug.profiler_output_dir "c:\temp" |
|
3966
by vain
- added extra htaccess without comments (you might just rename that to .htaccess) |
38 |
</IfModule> |
39 |
||
40 |
# Exlude .svn files (in case you are fetching directly from svn to the webserver) |
|
41 |
<Files .htaccess, .svn> |
|
42 |
Order allow, deny |
|
43 |
Deny from all |
|
44 |
</Files> |
|
45 |
||
46 |
# (6) Apache2 with "LoadModule mod_deflate" |
|
47 |
# for output compression of the following specific file-content-types: |
|
48 |
||
49 |
<IfModule mod_deflate.c> |
|
50 |
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript |
|
51 |
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary |
|
52 |
SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary |
|
53 |
</IfModule> |
|
54 |
||
55 |
# (7) Apache2 with "LoadModule mod_rewrite" |
|
56 |
# for Rewrite Engine and Rewrite Rules (for Apache) |
|
57 |
||
58 |
<IfModule mod_rewrite.c> |
|
59 |
||
60 |
# (7a) Turn Rewrite Engine on |
|
61 |
||
62 |
RewriteEngine on |
|
63 |
# uncomment for better debugging of rewrite rules |
|
64 |
#RewriteLog /var/log/apache2/clansuite-rewrite.log |
|
65 |
||
66 |
# (7b) Set the Base for the Rewrite Engine (which is the path to your /Clansuite Directory) |
|
67 |
# Examples: |
|
68 |
# RewriteBase /YourClansuiteDirectory |
|
69 |
# RewriteBase / |
|
70 |
||
71 |
#RewriteBase / |
|
72 |
||
73 |
# (7c) Rewrite Rules |
|
4303
by vain
- xdebug settings added to htaccess |
74 |
|
3966
by vain
- added extra htaccess without comments (you might just rename that to .htaccess) |
75 |
# if it's not a file AND it's not a directory |
76 |
RewriteCond %{REQUEST_FILENAME} !-f |
|
77 |
RewriteCond %{REQUEST_FILENAME} !-d |
|
4303
by vain
- xdebug settings added to htaccess |
78 |
|
3966
by vain
- added extra htaccess without comments (you might just rename that to .htaccess) |
79 |
# disable rewrite for css, images, javascript, archives and pdf,txt |
80 |
#RewriteCond %{REQUEST_FILENAME} !\.(?:png|gif|jpeg|jpg|pdf|php|js|ico|txt|css|rar|zip|tar\.gz)$ |
|
81 |
||
82 |
# route all non-ressource/file/dir requests to index.php |
|
83 |
#RewriteRule ^(.*).(.*)? index.php?mod=$1&action=$2 |
|
84 |
||
85 |
# all requests are redirected the frontcontroller (index.php) |
|
86 |
RewriteRule ^(.*)$ index.php [QSA,L] |
|
87 |
||
88 |
</IfModule> |
|
89 |
||
90 |
# (8) Apache2 with "LoadModule mod_expires" |
|
91 |
# Removed Etag + Smaller Header for image, javascript, css files with cache lifetime 1 year+ |
|
92 |
||
93 |
<IfModule mod_expires.c> |
|
94 |
<FilesMatch "\.(ico|gif|jpg|jpeg|png|swf|css|js|html?|xml|txt)$"> |
|
95 |
ExpiresActive On |
|
96 |
ExpiresDefault "access plus 1 years" |
|
97 |
</FilesMatch> |
|
98 |
</IfModule> |
|
99 |
||
100 |
# (9) Apache2 with "LoadModule mod_headers" |
|
101 |
# Turns off ETags (check for newer version of file) |
|
102 |
# Forces webbrowser to rely on Cache-Control and Expires headers |
|
103 |
||
104 |
<IfModule mod_headers.c> |
|
105 |
Header unset ETag |
|
106 |
Header unset Last-Modified |
|
107 |
</IfModule> |
|
108 |
<FilesMatch "\.(ico|gif|jpg|jpeg|png|swf|css|js|html?|xml|txt)$"> |
|
109 |
FileETag none |
|
110 |
</FilesMatch> |
|
111 |
||
112 |
# (10) Apache2 with "LoadModule mod_gzip" |
|
113 |
# Compresses your Content |
|
114 |
||
115 |
<IfModule mod_gzip.c> |
|
116 |
mod_gzip_on Yes |
|
117 |
mod_gzip_dechunk Yes |
|
118 |
mod_gzip_item_include file \.(html?|txt|xml|css|js|php|pl|gif|jpg|jpeg|png|swf)$ |
|
119 |
mod_gzip_item_include handler ^cgi-script$ |
|
120 |
mod_gzip_item_include mime ^text/.* |
|
121 |
mod_gzip_item_include mime ^application/x-javascript.* |
|
122 |
mod_gzip_item_exclude mime ^image/.* |
|
123 |
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.* |
|
124 |
</IfModule> |
|
125 |
||
126 |
# (11) If you have trouble uploading larger files, increase the maximum file size. |
|
127 |
# |
|
128 |
#<IfModule mod_php5.c> |
|
129 |
# php_value upload_max_filesize -1 |
|
130 |
# php_value post_max_size 512M |
|
131 |
# php_value memory_limit -1 |
|
132 |
# php_value max_input_time -1 |
|
133 |
# php_value max_execution_time 0 |
|
134 |
# php_value error_reporting 5 |
|
135 |
#</IfModule> |
|
136 |