Skip to content

Instantly share code, notes, and snippets.

@reiro
Created November 13, 2017 12:13
Show Gist options
  • Save reiro/a40d488121cb2395ada955c14057ca0b to your computer and use it in GitHub Desktop.
Save reiro/a40d488121cb2395ada955c14057ca0b to your computer and use it in GitHub Desktop.
ap.conf r&h
<VirtualHost *:81>
ServerName rhlive.cavwebservices.com
ServerAlias rhlivec.cavwebservices.com
ServerAlias rhbeta.cavwebservices.com
ServerAlias rhnarooma.com.au
ServerAlias www.rhnarooma.com.au
ServerAlias www.manlymanor.com.au
ServerAlias manlymanor.com.au
# Other domains that should get rewritten to the domain above
ServerAlias raineandhorne.com.au
ServerAlias www.raineandhorne.com.au
ServerAlias rh.com.au
ServerAlias www.rh.com.au
ServerAlias rhwa.com.au
ServerAlias www.rhwa.com.au
ServerAlias uat.rh.com.au
ServerAlias ap.rapidmango.com.au
ServerAlias rhq.com.au
ServerAlias www.rhq.com.au
ServerAlias raineandhorne.vu
ServerAlias www.raineandhorne.vu
ServerAlias rainedandhornecommercial.com.au
ServerAlias www.raineandhornecommercial.com.au
ServerAlias rhc.com.au
ServerAlias www.rhc.com.au
ServerAlias rhcommercial.com.au
ServerAlias www.rhcommercial.com.au
ServerAlias rhtas.com.au
ServerAlias www.rhtas.com.au
ServerAlias rhbj.com
ServerAlias rhbj.com.au
ServerAlias rhbjcc.com
ServerAlias rhbjcc.com.au
ServerAlias rhcc.com
ServerAlias www.rhbj.com
ServerAlias www.rhbj.com.au
ServerAlias www.rhbjcc.com
ServerAlias www.rhbjcc.com.au
ServerAlias www.rhcc.com
RewriteEngine On
SSLEngine off
# Maintenance page
RewriteCond %{REQUEST_URI} !\.(css|gif|jpg|png)$
RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.
RewriteRule ^.*$ /maintenance.html [L]
RewriteRule ^/(.*)/+$ $1 [R=301,L]
# 80-redirect-commercial-marrickville-to-southsydney
RewriteCond %{HTTP_HOST} ^(www\.)?rhcommercial\.com\.au/?$ [OR]
RewriteCond %{HTTP_HOST} ^(www\.)?rhc\.com\.au/?$
RewriteRule ^/marrickville(.*)$ /southsydney$1 [last,redirect=301,noescape]
#market landing page at sparcmedia
RewriteCond %{HTTP_HOST} ^(www\.)?raineandhorne\.com\.au/?$ [OR]
RewriteCond %{HTTP_HOST} ^(www\.)?rh\.com\.au/?$ [OR]
RewriteRule ^/home$ http://listyourhome.rh.com.au [last,noescape]
RewriteCond %{HTTP_HOST} ^(www\.)?raineandhorne\.com\.au/?$ [OR]
RewriteCond %{HTTP_HOST} ^(www\.)?rh\.com\.au/?$ [OR]
RewriteRule ^/(ettalongbeach|ettalong|uminabeach|woywoy|sthubertsisland)(.*)$ /eusw$2 [last,redirect=301,noescape]
#double bay blog
RewriteCond %{HTTP_HOST} ^(www\.)?raineandhorne\.com\.au/?$
RewriteRule ^/doublebay/blog$ http://ec2-54-66-134-97.ap-southeast-2.compute.amazonaws.com/ [P]
ProxyPassReverse /doublebay/blog http://ec2-54-66-134-97.ap-southeast-2.compute.amazonaws.com/
RewriteCond %{HTTP_HOST} ^(www\.)?raineandhorne\.com\.au/?$ [OR]
RewriteCond %{HTTP_HOST} ^(www\.)?rh\.com\.au/?$ [OR]
RewriteRule ^/(burpengary|morayfield|northlakes)(.*)$ /BMN$2 [last,redirect=301,noescape]
RewriteCond %{HTTP_HOST} ^(www\.)?raineandhorne\.com\.au/?$
RewriteRule ^/doublebay/blog/(.*)$ http://ec2-54-66-134-97.ap-southeast-2.compute.amazonaws.com/ [P]
ProxyPassReverse /doublebay/blog/ http://ec2-54-66-134-97.ap-southeast-2.compute.amazonaws.com/
RewriteCond %{HTTP_HOST} ^(www\.)?raineandhorne\.com\.au/?$ [OR]
RewriteCond %{HTTP_HOST} ^(www\.)?rh\.com\.au/?$ [OR]
RewriteCond %{HTTP_HOST} ^(www\.)?rhlive\.cavwebservices\.com/?$ [OR]
RewriteRule ^/doublebay/(.*)$ /doublebaybondibeach/$1 [last,redirect=301,noescape]
RewriteCond %{HTTP_HOST} ^(www\.)?raineandhorne\.com\.au/?$ [OR]
RewriteCond %{HTTP_HOST} ^(www\.)?rh\.com\.au/?$ [OR]
RewriteCond %{HTTP_HOST} ^(www\.)?rhlive\.cavwebservices\.com/?$ [OR]
RewriteRule ^/mermaidbeach(.*)$ /mermaid$1 [last,redirect=301,noescape]
RewriteCond %{HTTP_HOST} ^(www\.)?raineandhorne\.com\.au/?$ [OR]
RewriteCond %{HTTP_HOST} ^(www\.)?rh\.com\.au/?$ [OR]
RewriteRule ^/(killarneyvale|berkeleyvale)(.*)$ /toowoonbay/$2 [last,redirect=301,noescape]
RewriteCond %{HTTP_HOST} ^(www\.)?raineandhorne\.com\.au/?$ [OR]
RewriteCond %{HTTP_HOST} ^(www\.)?rh\.com\.au/?$ [OR]
RewriteRule ^/salisburysa(.*)$ /salisbury$1 [last,redirect=301,noescape]
RewriteCond %{HTTP_HOST} ^(www\.)?raineandhorne\.com\.au/?$ [OR]
RewriteCond %{HTTP_HOST} ^(www\.)?rh\.com\.au/?$ [OR]
RewriteRule ^/mm(.*)$ /ulladulla/$1 [last,redirect=301,noescape]
RewriteCond %{HTTP_HOST} ^(www\.)?raineandhorne\.com\.au/?$ [OR]
RewriteCond %{HTTP_HOST} ^(www\.)?rh\.com\.au/?$ [OR]
RewriteCond %{HTTP_HOST} ^(www\.)?rhlive\.cavwebservices\.com/?$ [OR]
RewriteRule ^/doublebay$ /doublebaybondibeach [last,redirect=301,noescape]
RewriteCond %{HTTP_HOST} ^(www\.)?raineandhorne\.com\.au/?$ [OR]
RewriteCond %{HTTP_HOST} ^(www\.)?rh\.com\.au/?$ [OR]
RewriteCond %{HTTP_HOST} ^(www\.)?rhlive\.cavwebservices\.com/?$ [OR]
RewriteRule ^/bondibeach/(.*)$ /doublebaybondibeach/$1 [last,redirect=301,noescape]
RewriteCond %{HTTP_HOST} ^(www\.)?raineandhorne\.com\.au/?$ [OR]
RewriteCond %{HTTP_HOST} ^(www\.)?rh\.com\.au/?$ [OR]
RewriteCond %{HTTP_HOST} ^(www\.)?rhlive\.cavwebservices\.com/?$ [OR]
RewriteRule ^/bondibeach$ /doublebaybondibeach [last,redirect=301,noescape]
# no find agent for offices
RewriteRule ^/.+?\/(real-estate-agents\/.*) /$1 [last,redirect=301,noescape]
# Redmine 11578
RewriteRule ^(/.*)?/properties/333274 $1/properties/355300 [last,redirect=301,noescape]
#Redirect / http://www.raineandhorne.com.au/narooma
RewriteCond %{HTTP_HOST} ^(www\.)?manlymanor\.com\.au [nocase]
RewriteRule ^/?(.*) http://www.raineandhorne.com.au/onsitesales/cms_lists/1435/cms_items/3843/cms_pages/1546 [last,redirect=301,noescape]
RewriteCond %{HTTP_HOST} ^(www\.)?rhnarooma\.com\.au [nocase]
RewriteRule ^/?(.*) http://www.raineandhorne.com.au/narooma [last,redirect=301,noescape]
# Redmine 6217
RewriteCond %{HTTP_HOST} ^(www\.)?raineandhorne\.com\.au/?$ [OR]
RewriteCond %{HTTP_HOST} ^(www\.)?rh\.com\.au/?$
RewriteRule ^/wagga$ http://www.raineandhorne.com.au/waggawagga [last,redirect=301,noescape]
RewriteCond %{HTTP_HOST} ^(www\.)?rhcommercial\.com\.au/?$ [OR]
RewriteCond %{HTTP_HOST} ^(www\.)?rhc\.com\.au/?$
RewriteRule ^/wagga$ http://www.rhcommercial.com.au/waggawagga [last,redirect=301,noescape]
# Redmine 9315
RewriteRule ^/bowral(.*) http://www.raineandhorne.com.au/southernhighlands$1 [last,redirect=301,noescape]
RewriteRule ^/mossvale(.*) http://www.raineandhorne.com.au/southernhighlands$1 [last,redirect=301,noescape]
#Someone wants all the seo's
RewriteRule ^/properties/81746 http://www.raineandhorne.com.au/properties/219714 [last,noescape]
#Vanuatu rewrite
RewriteCond %{HTTP_HOST} ^www.raineandhorne.vu$ [nocase]
RewriteRule ^/(.*) http://www.raineandhorne.com.au/vanuatu [last,redirect=301,noescape]
#dubai rewrite
RewriteCond %{HTTP_HOST} ^rhdubai.ae$ [nocase]
RewriteRule ^/(.*) http://www.raineandhorne.com.au/dubai [last,redirect=301,noescape]
RewriteCond %{HTTP_HOST} ^www.rhdubai.ae$ [nocase]
RewriteRule ^/(.*) http://www.raineandhorne.com.au/dubai [last,redirect=301,noescape]
#terrigal 12609
RewriteCond %{HTTP_HOST} ^www.raineandhorne.com.au$ [NC]
RewriteRule ^/avoca$ http://www.raineandhorne.com.au/terrigal [last,redirect=301,noescape]
RewriteCond %{HTTP_HOST} ^www.raineandhorne.com.au$ [NC]
RewriteRule ^/avoca/(.*)$ http://www.raineandhorne.com.au/terrigal/$1 [last,redirect=301,noescape]
RewriteCond %{HTTP_HOST} ^www.raineandhorne.com.au$ [NC]
RewriteRule ^/avocabeach$ http://www.raineandhorne.com.au/terrigal [last,redirect=301,noescape]
RewriteCond %{HTTP_HOST} ^www.raineandhorne.com.au$ [NC]
RewriteRule ^/avocabeach/(.*)$ http://www.raineandhorne.com.au/terrigal/$1 [last,redirect=301,noescape]
RewriteCond %{HTTP_HOST} ^www.raineandhorne.com.au$ [NC]
RewriteRule ^/saratoga$ http://www.raineandhorne.com.au/terrigal [last,redirect=301,noescape]
# Redmine 12749
RewriteCond %{HTTP_HOST} ^www.raineandhorne.com.au$ [NC]
RewriteRule ^/jindabyne$ http://www.raineandhorne.com.au/snowymountains [last,redirect=301,noescape]
RewriteCond %{HTTP_HOST} ^www.raineandhorne.com.au$ [NC]
RewriteRule ^/jindabyne/(.*)$ http://www.raineandhorne.com.au/snowymountains/$1 [last,redirect=301,noescape]
RewriteCond %{HTTP_HOST} ^www.raineandhorne.com.au$ [NC]
RewriteRule ^/thredbo$ http://www.raineandhorne.com.au/snowymountains [last,redirect=301,noescape]
RewriteCond %{HTTP_HOST} ^www.raineandhorne.com.au$ [NC]
RewriteRule ^/thredbo/(.*)$ http://www.raineandhorne.com.au/snowymountains/$1 [last,redirect=301,noescape]
#Deewhy resi 9950
RewriteCond %{HTTP_HOST} ^www.raineandhorne.com.au$ [NC]
RewriteRule ^/deewhy$ http://www.raineandhorne.com.au/deewhycollaroy [last,redirect=301,noescape]
#Deewhy resi 9950
RewriteCond %{HTTP_HOST} ^www.raineandhorne.com.au$ [NC]
RewriteRule ^/deewhy/(.*) http://www.raineandhorne.com.au/deewhycollaroy/$1 [last,redirect=301,noescape]
#Deewhy resi 9950
RewriteCond %{HTTP_HOST} ^www.raineandhorne.com.au$ [NC]
RewriteRule ^/collaroy(.*) http://www.raineandhorne.com.au/deewhycollaroy$1 [last,redirect=301,noescape]
#Deewhy rewrite - ADDED 2/9/2011 AJH
RewriteCond %{HTTP_HOST} ^www.rhcommercial.com.au$ [NC]
RewriteRule ^/deewhy(.*) http://www.rhcommercial.com.au/northernbeaches$1 [last,redirect=301,noescape]
# leichhardt redirecrs - ADDED 2/11/2011 AJH
RewriteCond %{HTTP_HOST} ^www.raineandhorne.com.au$ [NC]
RewriteRule ^/annandale http://www.raineandhorne.com.au/leichhardt [last,redirect=301,noescape]
RewriteRule ^/drummoyne http://www.raineandhorne.com.au/leichhardt [last,redirect=301,noescape]
RewriteRule ^/balmain http://www.raineandhorne.com.au/leichhardt [last,redirect=301,noescape]
RewriteRule ^/balmain http://www.raineandhorne.com.au/leichhardt [last,redirect=301,noescape]
# RM #2481
RewriteCond %{HTTP_HOST} ^www.raineandhorne.com.au$ [NC]
RewriteRule ^/rosnypark(.*) http://www.raineandhorne.com.au/easternshore$1 [last,redirect=301,noescape]
# RM #2644
RewriteRule ^/chatswood(.*) http://www.raineandhorne.com.au/rhcw$1 [last,redirect=301,noescape]
RewriteRule ^/willoughby(.*) http://www.raineandhorne.com.au/rhcw$1 [last,redirect=301,noescape]
# RM9091
RewriteCond %{HTTP_HOST} ^www.raineandhorne.com.au$ [NC]
RewriteRule ^/onsiterights(.*) http://www.rhcommercial.com.au/onsiterights$1 [last,redirect=301,noescape]
#mandurah rewrite
RewriteRule ^/mandurah/commercial$ http://www.raineandhorne.com.au/mandurah/search/properties?suburbs[]=&keywords[]=Enter+Keywords+or+Property+ID&surrounding_suburbs=1&offer_type_code=sale&status=active&listing_type=commercial&scope=all&x=26&y=16 [last,redirect=301,noescape]
RewriteRule ^/mandurah/commleasing$ http://www.raineandhorne.com.au/mandurah/search/properties?suburbs[]=&keywords[]=Enter+Keywords+or+Property+ID&surrounding_suburbs=1&offer_type_code=rental&listing_type=commercial&scope=all&x=150&y=10 [last,redirect=301,noescape]
RewriteRule ^/mandurah/rural$ http://www.raineandhorne.com.au/mandurah/search/properties?suburbs[]=&keywords[]=Enter+Keywords+or+Property+ID&surrounding_suburbs=1&offer_type_code=sale&status=active&listing_type=rural&scope=all&x=59&y=17 [last,redirect=301,noescape]
RewriteRule ^/mandurah/ladybrand http://www.raineandhorne.com.au/mandurah/search/properties?suburbs[]=&keywords[]=lady+brand&surrounding_suburbs=1&offer_type_code=sale&status=active&listing_type=&scope=all&x=0&y=0 [last,redirect=301,noescape]
RewriteRule ^/mandurah/vacantland http://www.raineandhorne.com.au/mandurah/search/properties?suburbs[]=&keywords[]=land&surrounding_suburbs=1&offer_type_code=sale&status=active&listing_type=&scope=all&x=164&y=24 [last,redirect=301,noescape]
# RT7689
RewriteCond %{HTTP_HOST} rhbj.com$ [OR]
RewriteCond %{HTTP_HOST} rhbj.com.au$ [OR]
RewriteCond %{HTTP_HOST} rhbjcc.com$ [OR]
RewriteCond %{HTTP_HOST} rhbjcc.com.au$ [OR]
RewriteCond %{HTTP_HOST} rhcc.com$
RewriteRule ^.*$ http://www.rh.com.au/bjcc [last,redirect=301,noescape]
#commercial rewrite
RewriteCond %{HTTP_HOST} ^(www.|)raineandhorne\.com\.au$ [nocase]
RewriteRule ^/?commercial(/.*|)$ http://www.rhcommercial.com.au$1 [last,redirect=301,noescape]
# See redmine ticket #890 - special redirect for incorrectly printed brochure
RewriteCond %{HTTP_HOST} ^www\.rhc\.com\.au$ [nocase]
RewriteRule ^/commercialcbd/?$ http://www.rhcommercial.com.au/sydneycbd [last,redirect=301,noescape]
RewriteCond %{HTTP_HOST} ^(www.|)(raineandhornecommercial|rhc)\.com\.au$ [nocase]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^/?(.*) http://www.rhcommercial.com.au/$1 [last,redirect=301,noescape]
# Fallout from RM#4286
RewriteRule ^/hobartcommercial http://www.rhcommercial.com.au/hobart [nocase,last,redirect=301]
# Ensure rhcommercial is canonicalised to rhcommercial not raineandhorne
RewriteCond %{HTTP_HOST} ^rhcommercial.com.au$ [nocase]
RewriteRule ^/?(.*) http://www.rhcommercial.com.au/$1 [last,redirect=301,noescape]
RewriteCond %{HTTP_HOST} ^(www.|)rh\.com\.au$ [nocase]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^/?(.*) http://www.raineandhorne.com.au/$1 [last,redirect=301,noescape]
# Rewrite aliases to Canonical Domain - exclude the elb healthcheck url
# RewriteCond %{HTTP_HOST} !^www\.raineandhorne\.com\.au [nocase]
# RewriteCond %{HTTP_HOST} !^www\.rhcommercial\.com\.au [nocase]
# RewriteCond %{HTTP_HOST} !^$
# RewriteCond %{HTTP_USER_AGENT} !^ELB-HealthChecker/1.0 [nocase]
# RewriteRule ^/?(.*) http://www.raineandhorne.com.au/$1 [last,redirect=301,noescape]
# Rdirect non www host to www version
RewriteCond %{HTTP_HOST} ^raineandhorne\.com\.au$ [nocase]
RewriteRule ^/?(.*) http://www.raineandhorne.com.au/$1 [last,redirect=301,noescape]
# Special rewrites
#RewriteCond %{HTTP_HOST} !^(www\.)?manlymanor\.com\.au [nocase]
#RewriteRule ^/?(.*) http://www.raineandhorne.com.au/onsitesales/cms_lists/1435/cms_items/3843/cms_pages/1546 [last,redirect=301,noescape]
RewriteRule ^/shoalhavenheads$ http://www.raineandhorne.com.au/nowra [L]
RewriteRule ^/peak$ http://guest.cvent.com/i.aspx?5S,M3,8f413b30-6c3a-4a5d-bb4c-0c50d7a8af59 [L]
RewriteRule ^/peak2010$ http://guest.cvent.com/i.aspx?5S,M3,8f413b30-6c3a-4a5d-bb4c-0c50d7a8af59 [L]
RewriteRule ^/joinus$ http://realopportunity.com.au/index.php/reaql-opportunity/nsw.html [L]
RewriteRule ^/bayislands$ http://www.raineandhorne.com.au/macleayisland [L]
# Passenger configs
RailsEnv production
PassengerEnabled On
# Compress output
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css application/x-javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# Cache our stuff - requires mod_expires
ExpiresActive On
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType text/javascript "access plus 1 month"
ExpiresByType application/x-javascript "access plus 1 month"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
DocumentRoot "/opt/apps/ap/current/public"
CustomLog /var/log/apache2/ap-access.log "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""
ErrorLog /var/log/apache2/ap-error.log
<Directory "/opt/apps/ap/current/public">
Order allow,deny
Allow from all
</Directory>
Alias "/queuemonitor" "/var/www/mrtg"
<Directory "/var/www/mrtg">
AuthType Basic
AuthName "Authentication Required"
AuthUserFile "/etc/apache2/mrtg-htpasswd"
Require valid-user
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment