forked from stuporglue/TreeTrumpet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhtaccess
More file actions
59 lines (50 loc) · 2.14 KB
/
Copy pathhtaccess
File metadata and controls
59 lines (50 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# This file isn't required for TreeTrumpet, but if your server supports it, this file will:
# * Enable caching
# * Give you prettier URLs (/individual/id/name instead of individual.php/id/name)
# * Bump up PHP's max memory (TODO)
# * Increase security by denying access to sub-directories (TODO)
# Add some caching
AddType image/x-icon .ico
<IfModule mod_expires.c>
ExpiresActive on
ExpiresByType image/x-icon "access plus 1 year"
<FilesMatch "\.(ico|jpg|jpeg|png|gif|js|css|swf)$">
ExpiresDefault "access plus 2 months"
</FilesMatch>
</IfModule>
FileETag none
<ifModule mod_headers.c>
Header unset ETag
</ifModule>
# Do some pretty URLs!
<IfModule mod_rewrite.c>
# Disable multiviews so that /tree doesn't try to map to /tree.html or something silly like that
Options -MultiViews
RewriteEngine On
## We provide a hard coded robots.txt with a relative xmlsitemap link in case the server
## doesn't support .htaccess or mod_rewrite. If it does support it, then we can use
## the preferred full URL to access the sitemap and make it look like it ends in .xml
RewriteRule robots.txt index.php?ruri=robots [L]
RewriteRule xmlsitemap.xml index.php?ruri=xmlsitemap [L]
## All PHP requests should go through index.php (except index.php)
RewriteCond %{REQUEST_FILENAME} !index.php
RewriteCond %{REQUEST_URI} (.*)\.php(.*)
RewriteRule .* %1%2 [R,L,QSA]
## We need to redirect requests for / so they have an ruri component so we
## can tell if we need the .php suffix on our links or not
RewriteCond %{REQUEST_FILENAME} index.php
RewriteCond %{QUERY_STRING} ^$
RewriteRule . index.php?ruri=index
## Lastly, any files which don't exist should go through index.php
## All our controllers should exist since we need to work where mod_rewrite might not be set up
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !.*index.php
RewriteRule . index.php?ruri=%{REQUEST_URI} [PT,QSA]
</IfModule>
# Try to set the memory limit higher.
# We have to read the whole GEDCOM file
# at least once (if we're caching), maybe
# more often.
php_value memory_limit 1024M
php_value max_execution_time 600