Skip to content

Instantly share code, notes, and snippets.

@ryanschuhler
Created March 1, 2016 17:11
Show Gist options
  • Save ryanschuhler/1f7d371ce001b0b74a7b to your computer and use it in GitHub Desktop.
Save ryanschuhler/1f7d371ce001b0b74a7b to your computer and use it in GitHub Desktop.
# Virtual Hosts
#
# Required modules: mod_log_config
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.4/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
#<VirtualHost *:80>
# ServerAdmin [email protected]
# DocumentRoot "/usr/docs/dummy-host.example.com"
# ServerName dummy-host.example.com
# ServerAlias www.dummy-host.example.com
# ErrorLog "/private/var/log/apache2/dummy-host.example.com-error_log"
# CustomLog "/private/var/log/apache2/dummy-host.example.com-access_log" common
#</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName localhost
ServerAlias *.localhost
JkMount /* ajp13
<ifModule mod_rewrite.c>
RewriteEngine On
SetEnvIf Request_URI "/down/.*" no-jk
SetEnvIf Request_URI "^/[^/]+-theme/css/.*" no-jk
SetEnvIf Request_URI "^/[^/]+-theme/images/.*" no-jk
SetEnvIf Request_URI "^/[^/]+-theme/js/.*" no-jk
#
# SSL for signed in users
#
# 80:RewriteCond %{HTTP_COOKIE} OSB_SIGNED_IN=true [NC,OR]
# 80:RewriteCond %{HTTP_COOKIE} REMEMBER_ME=true [NC]
# 80:RewriteRule .* https:\/\/%{SERVER_NAME}$0 [R]
#
# Internal Redirects
#
#
# Application Display Template Redirects
#
RewriteRule ^/?resource/([0-9]+)$ /resource?resourceId=$1 [PT,L]
RewriteRule ^/?resource/([0-9]+)/([A-Za-z0-9_+-]+)$ /resource?folderId=$1&title=$2 [PT,L]
RewriteRule ^/?resource/([A-Za-z0-9_+-]+)$ /resource?title=$1 [PT,L]
#
# Platform
#
RedirectMatch permanent ^/downloads/liferay-portal/additional-files$ /downloads#additional-files
RedirectMatch permanent ^/downloads/liferay-portal/available-releases$ /downloads
RedirectMatch permanent ^/downloads/liferay-portal/license-ce$ /downloads/ce-license
RedirectMatch permanent ^/downloads/liferay-portal/license-ee$ /downloads/ee-license
RedirectMatch permanent ^/downloads/liferay-portal/thanks-for-downloading$ /downloads/thanks-for-downloading
RedirectMatch permanent ^/license-ce$ /downloads/ce-license
RedirectMatch permanent ^/license-ee$ /downloads/ee-license
RedirectMatch permanent ^/liferay-connected-services /supporting-products/liferay-connected-services
RedirectMatch permanent ^/liferay-screens$ /supporting-products/liferay-screens
RedirectMatch permanent ^/liferay-sync$ /supporting-products/liferay-sync
RedirectMatch permanent ^/third-party-software$ /downloads/third-party-software
#
# Products
#
RedirectMatch permanent ^/products/liferay-cloud-services$ /supporting-products/liferay-connected-services
RedirectMatch permanent ^/products/liferay-connected-services$ /supporting-products/liferay-connected-services
RedirectMatch permanent ^/products/liferay-portal$ /platform/overview
RedirectMatch permanent ^/products/liferay-portal/ee$ /subscription-services
RedirectMatch permanent ^/products/liferay-portal/ee/30-day-trial$ /30-day-trial
RedirectMatch permanent ^/products/liferay-portal/ee/end-of-service-life$ /subscription-services/end-of-service-life
RedirectMatch permanent ^/products/liferay-portal/ee/faq$ /subscription-services#faq
RedirectMatch permanent ^/products/liferay-portal/ee/get-it-now$ /get-price-quote
RedirectMatch permanent ^/products/liferay-portal/ee/overview$ /subscription-services
RedirectMatch permanent ^/products/liferay-portal/ee/service-levels$ /subscription-services
RedirectMatch permanent ^/products/liferay-portal/ee/thank-you$ /subscription-services/thank-you
RedirectMatch permanent ^/products/liferay-portal/get-it-now$ /get-price-quote
RedirectMatch permanent ^/products/liferay-portal/get-price-quote$ /get-price-quote
RedirectMatch permanent ^/products/liferay-portal/get-price-quote/thank-you$ /subscription-services/thank-you
RedirectMatch permanent ^/products/liferay-portal/overview$ /platform/overview
RedirectMatch permanent ^/products/liferay-portal/tech-specs$ /platform/tech-specs
RedirectMatch permanent ^/products/liferay-screens$ /supporting-products/liferay-screens
RedirectMatch permanent ^/products/liferay-sync$ /supporting-products/liferay-sync
RedirectMatch permanent ^/products/liferay-sync/end-of-service-life$ /supporting-products/liferay-sync/end-of-service-life
RedirectMatch permanent ^/products/liferay-sync/features$ /supporting-products/liferay-sync
RedirectMatch permanent ^/products/liferay-sync/get-it-now$ /supporting-products/liferay-sync
RedirectMatch ^/products/liferay-portal/stories/(.*) /case-studies?resource=$1
#
# Services
#
RedirectMatch permanent ^/services/consulting$ /consulting
#
# Company
#
RedirectMatch permanent ^/about-us$ /company
RedirectMatch permanent ^/about-us/awards$ /company/awards
RedirectMatch permanent ^/about-us/awards/gartnermq-portals$ /company/gartner
RedirectMatch permanent ^/about-us/newsroom/newsletter-signup$ /company/press-releases/sign-up
RedirectMatch permanent ^/about-us/newsroom /press-releases
#
# Other Pages
#
RedirectMatch permanent ^/about-us/privacy$ /privacy-policy
RedirectMatch permanent ^/security$ /security-statement
#
# External Redirects
#
RewriteRule ^/about-us/leadership$ http://www-ryan/about-us/leadership/executive-team [P,L]
RewriteRule ^/about-us/leadership/(.*) http://www-ryan/about-us/leadership/$1 [P,L]
RewriteRule ^/company/leadership$ http://www-ryan/about-us/leadership/executive-team [P,L]
RewriteRule ^/about-us/newsroom$ http://www-ryan/about-us/newsroom/ [P,L]
RewriteRule ^/about-us/newsroom/(.*) http://www-ryan/about-us/newsroom/$1 [P,L]
RewriteRule ^/press-releases$ http://www-ryan/about-us/newsroom/press-releases/all [P,L]
RewriteRule ^/certification$ http://www-ryan/services/certification [P,L]
RewriteRule ^/services/certification$ http://www-ryan/services/certification [P,L]
RewriteRule ^/services/certification/(.*) http://www-ryan/services/certification/$1 [P,L]
RewriteRule ^/downloads/liferay-portal/overview$ http://www-ryan/downloads/liferay-portal/overview [P,L]
RewriteRule ^/downloads/liferay-projects/alloy-ui$ http://www-ryan/downloads/liferay-projects/alloyui [P,L]
RewriteRule ^/downloads/liferay-projects/liferay-faces$ http://www-ryan/downloads/liferay-projects/liferay-faces [P,L]
RewriteRule ^/downloads/liferay-projects/liferay-ide$ http://www-ryan/downloads/liferay-projects/liferay-developer-tools [P,L]
RewriteRule ^/downloads/liferay-sync$ http://www-ryan/downloads/liferay-sync [P,L]
RewriteRule ^/downloads/liferay-sync-portal-6-1$ http://www-ryan/downloads/liferay-sync-portal-6-1 [P,L]
RewriteRule ^/downloads/liferay-sync/third-party-software$ http://www-ryan/downloads/liferay-sync/third-party-software [P,L]
RewriteRule ^/events$ http://www-ryan/events [P,L]
RewriteRule ^/events/(.*) http://www-ryan/events/$1 [P,L]
RewriteRule ^/getting-started$ http://www-ryan/getting-started [P,L]
RewriteRule ^/onboarding/form$ http://www-ryan/onboarding/form [P,L]
RewriteRule ^/services/support/compatibility-matrix$ http://www-ryan/services/support/compatibility-matrix [P,L]
RewriteRule ^/partners$ http://www-ryan/partners [P,L]
RewriteRule ^/partners/(.*) http://www-ryan/partners/$1 [P,L]
RewriteRule ^/products/liferay-portal/benefits(.*) http://www-ryan/products/liferay-portal/benefits$1 [P,L]
RewriteRule ^/products/liferay-portal/ee/30-day-trial/forum$ http://www-ryan/products/liferay-portal/ee/30-day-trial/forum [P,L]
RewriteRule ^/products/liferay-portal/features$ http://www-ryan/products/liferay-portal/features [P,L]
RewriteRule ^/products/liferay-portal/liferay-portal-6.2$ http://www-ryan/products/liferay-portal/liferay-portal-6.2 [P,L]
RewriteRule ^/products/what-is-a-portal(.*) http://www-ryan/products/what-is-a-portal$1 [P,L]
RewriteRule ^/services/training$ http://www-ryan/services/training [P,L]
RewriteRule ^/services/training/(.*) http://www-ryan/services/training/$1 [P,L]
RewriteRule ^/training$ http://www-ryan/services/training [P,L]
RewriteRule ^/support$ http://www-ryan/support [P,L]
RewriteRule ^/support/(.*) http://www-ryan/support/$1 [P,L]
RewriteRule ^/video$ http://www-ryan/video [P,L]
RewriteCond %{HTTP_HOST} ^platform.localhost
RewriteRule ^/platform/(.*) /$1 [R]
RewriteCond %{HTTP_HOST} ^platform.localhost
RewriteRule ^/(.*) /platform/$1 [PT,L]
</ifModule>
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / ajp://localhost:8009/
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName www-ryan
ServerAlias *.www-ryan
JkMount /* ryan
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^community.www-ryan
RewriteRule ^community/(.*) $1
RewriteCond %{HTTP_HOST} ^community.www-ryan
RewriteRule (.*) /community/$1 [P,L]
</ifModule>
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / ajp://www-ryan:8019/
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment