publicwhip/publicwhip/master/website/.htaccess - Htaccess File

publicwhip/publicwhip/master/website/.htaccess

# .htaccess file 

<FilesMatch "^(mp-info.xml|dreamquery.xml|mpdream-info.xml)$">
    AddType application/x-httpd-php .xml
</FilesMatch>
Options ExecCGI
DirectoryIndex index.php
AddHandler cgi-script .cgi
# make things safe
#php_flag register_globals off # doesn't work / not needed for PHP5
<Files ~ ".inc$">
    Order allow,deny
    Deny from all
</Files>

# all links on publicwhip.org.uk are permalinks
# this lets us move pages without breaking them
RedirectPermanent /rebels.php http://www.publicwhip.org.uk/mps.php?sort=rebellions
RedirectPermanent /news.php http://www.publicwhip.org.uk/newsletters/archive.php
RedirectPermanent /code.php http://www.publicwhip.org.uk/project/code.php
RedirectPermanent /mp-info.xml http://www.publicwhip.org.uk/feeds/mp-info.xml
RedirectPermanent /dreammp.php http://www.publicwhip.org.uk/policy.php

RewriteCond %{HTTP_HOST} !^(www.publicwhip.org.uk|pw.live|publicwhip-v1.localdomain)$
RewriteRule (.*) http://www.publicwhip.org.uk/$1 [R=301,L]
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{QUERY_STRING} (.*)Louise_Bagshawe(.*)
RewriteRule ^ %{REQUEST_URI}?%1Louise_Mensch%2 [R=302,L]

RewriteRule ^testrewrite$ /index.php [PT]
RewriteRule ^[Nn]/([^;]+)$                      /newsletters/signup.php?token=$1
RewriteRule ^[Uu]/([^;]+)$                      /newsletters/signup.php?token=$1&unsub=1
RewriteRule ^byelection$ /election_glenrothes2008.php [PT]
RewriteRule ^by-election$ /election_glenrothes2008.php?dash=yes [PT]
RewriteRule ^fortytwodays$ /fortytwodays.php [PT]

RewriteRule ^forum.*$ /outageforums.php [R=302,L]
RewriteRule ^account.*$ /outageforums.php [R=302,L]

# Net strike
#RewriteCond %{REQUEST_URI} !^/patents/patents.php
#RewriteCond %{REQUEST_URI} !^/thepublicwhip.gif
#RewriteCond %{REQUEST_URI} !^/publicwhip.css
#RewriteCond %{REQUEST_URI} !^/mp-info.xml
#RewriteRule .*          http://www.publicwhip.org.uk/patents/patents.php [R=302,L]

# Alternative way of net striking:
#RedirectMatch /[^p] http://www.publicwhip.org.uk/patents/patents.php

On Github License

Files

Download PDF of Htaccess file
HTTP_HOST, QUERY_STRING, REQUEST_URI

Comments

Apache