+forgotten IMAP4
[www.jankratochvil.net.git] / .htaccess
1 <IfModule mod_dir.c>
2         DirectoryIndex _NOTEXISTS
3         IndexOptions NameWidth=*
4 </IfModule>
5
6 Options None
7 <IfModule !mod_perl.c>
8         Options +Indexes
9         # For "*.shtml" as "./project/Islet/Islet/Islet.shtml" etc.
10         Options +Includes
11         # Prevent: Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden
12         Options +SymLinksIfOwnerMatch
13 </IfModule>
14
15 AddHandler server-parsed .shtml
16 AddHandler cgi-script .cgi
17
18 AddType "text/html; charset=us-ascii" .html
19 AddType "text/html; charset=us-ascii" .shtml
20 AddType "text/plain; charset=us-ascii" .txt
21 AddType "text/plain; charset=us-ascii" .asc
22 AddType application/x-rpm .rpm
23 AddType application/x-nokia-9000-communicator-add-on-software .aos
24 AddType application/vnd.symbian.install .sis
25
26 RemoveEncoding .gz .Z .bz .bz2 .zip
27 AddType application/x-gzip .gz
28 AddType application/x-compress .Z
29 AddType application/x-bzip .bz
30 AddType application/x-bzip2 .bz2
31 AddType application/zip .zip
32
33 # Do not: text/javascript
34 # as it does not look as registered, at least according to: MIME::Types $VERSION 1.15
35 # "application/javascript" so far standardized till 2005-12-08 by:
36 #       http://www.ietf.org/internet-drafts/draft-hoehrmann-script-types-03.txt
37 AddType application/javascript .js
38
39 <IfModule mod_php.c>
40         php_flag short_open_tag off
41         php_flag magic_quotes_gpc off
42         php_flag magic_quotes_runtime off
43 </IfModule>
44
45 <IfModule mod_rewrite.c>
46         # Do not: [R=301] [L]
47         # as any non-1st brackets' contents would get ignored!
48         # Use always suffix: ?${unescape:%{QUERY_STRING}}
49         # as $QUERY_STRING gets otherwise double-escaped (or if "NE" the path gets unescaped).
50         # FIXME: Should be applied also for the "P" rules?
51         # WARNING: Requires server/virtualhost definition: RewriteMap unescape int:unescape
52         RewriteEngine on
53         RewriteRule ^kocky(|/.*)$ http://kocky.vellum.cz/$1?${unescape:%{QUERY_STRING}} [R=301,L]
54         RewriteRule ^(4cinfo|4c)(|/.*)$ http://4c.jankratochvil.net/$2?${unescape:%{QUERY_STRING}} [R=301,L]
55         RewriteRule ^sw(|/.*)$ http://%{SERVER_NAME}/project$1?${unescape:%{QUERY_STRING}} [R=301,L]
56         RewriteRule ^(project|product)s(|/.*)$ http://%{SERVER_NAME}/$1$2?${unescape:%{QUERY_STRING}} [R=301,L]
57         RewriteRule ^(mailman|pipermail|phorum|akra)(|/.*)$ http://www2.jankratochvil.net/$1$2?${unescape:%{QUERY_STRING}} [R=302,L]
58         <IfModule !mod_perl.c>
59                 RewriteRule ^favicon[.]ico$ /My/Status.pm?code=404 [P,L]
60                 RewriteRule ^(.*)[.](html|txt)[.]pl(|/.*)$ /$1.pm$3?${unescape:%{QUERY_STRING}} [R=301,L]
61                 RewriteRule ^resume/Resume-JanKratochvil.pm(|/.*)$ /resume/ResumeJanKratochvil.pm$1?${unescape:%{QUERY_STRING}} [R=301,L]
62                 RewriteRule ^(.*?)/+Index[.]pm$ /$1/?${unescape:%{QUERY_STRING}} [R=301,L]
63                 RewriteCond %{REQUEST_FILENAME}/Index.pm -f
64                 # It may be "" for the root directory:
65                 RewriteRule ^(|(.*?/)/*)$ http://localhost:7680/$2Index.pm [P,L]
66                 RewriteRule ^(.*[.]pm(|/.*))$ http://localhost:7680/$1 [P,L]
67         </IfModule>
68 </IfModule>