blob: c1b6d96c2931d69c7146922e8db58b3af74c05cb (
plain)
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
# Apache configuration for FixMyStreet.
#
# Add lines something like this to your /etc/apache2/sites-enabled/fixmystreet -
# replacing '/home/yourname/fixmystreet' with the path to your install
#
# # FixMyStreet
# <VirtualHost *:80>
# ServerName fixmystreet.yourservername
# DocumentRoot /home/yourname/fixmystreet/web/
#
# # Pull in the specific config
# Include /home/yourname/fixmystreet/conf/httpd.conf
#
# <Directory /home/yourname/fixmystreet/web>
# # You also need to enable cgi files to run as CGI scripts. For example:
# # on production servers these are run under fastcgi
# Options +ExecCGI
# AddHandler cgi-script .cgi
# AllowOverride None
# </Directory>
#
# <Location /admin>
# #
# # WARNING - enable auth here on production machine
# #
# Options +ExecCGI
# AddHandler cgi-script .cgi
# </Location>
#
# Alias /admin/ /home/yourname/fixmystreet/web-admin/
#
# Alias /jslib/ "/home/yourname/fixmystreet/commonlib/jslib/"
#
# </VirtualHost>
#
#
# Copyright (c) 2011 UK Citizens Online Democracy. All rights reserved.
# Email: team@mysociety.org
# WWW: http://www.mysociety.org
RewriteEngine on
# RewriteLog /var/log/apache2/rewrite.log
# RewriteLogLevel 3
# RSS feeds for voting areas
RewriteRule ^/rss/council/([0-9]+)$ /rss/reports/$1 [R=permanent,L]
RewriteRule ^/report$ /reports [R=permanent,L]
# Fix incorrect RSS urls caused by my stupidity
RewriteRule ^/{/rss/(.*)}$ /rss/$1 [R=permanent,L]
RewriteRule ^/reports/{/rss/(.*)}$ /rss/$1 [R=permanent,L]
# In case of misspelling
RewriteRule ^/alerts/?$ /alert [R=permanent,L]
# Proxy mapit so that our js code can make calls on the originating server. Use
# a RewriteRule rather than ProxyPass so that Apache's processing order is more
# predictable. ProxyPassReverse is not affected by this.
RewriteRule /mapit/(.*) http://mapit.mysociety.org/$1 [P,L]
ProxyPassReverse /mapit/ http://mapit.mysociety.org/
# serve static files directly
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f
RewriteRule /(.+) /$1 [L]
# Performance things
ExpiresActive On
ExpiresByType text/css "access plus 10 years"
ExpiresByType application/javascript "access plus 10 years"
<Location /js/>
AddOutputFilter DEFLATE js
</Location>
# Don't want jslib being passed to Catalyst
RewriteRule ^/jslib(.*) /jslib$1 [L,PT]
# trap anything that reaches us here and send it to the Catalyst app
RewriteRule ^(.*)$ /fixmystreet_app_fastcgi.cgi$1 [L]
|