From 90d9ea47de2ce9035b021dad5dd8e7b37b2c8538 Mon Sep 17 00:00:00 2001 From: Axel Uhl Date: Wed, 20 Jul 2016 22:45:05 +0200 Subject: [PATCH] handle QUERY_STRING better in apache 000-macros.conf; locale is now properly put before fragment in rewrite rules Change-Id: Ied02e5c7d7cedfc0707209dfaa48c8dc7fb952e0 --- configuration/000-macros.conf | 38 ++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/configuration/000-macros.conf b/configuration/000-macros.conf index cee541ab0eb..926d3f5a2f7 100755 --- a/configuration/000-macros.conf +++ b/configuration/000-macros.conf @@ -155,7 +155,9 @@ RewriteEngine on RewriteCond %{REQUEST_URI} "^(/)?$" - RewriteRule ^(/)?$ "http://$HOSTNAME/dashboards/RibDashboard.html?leaderboardName=$LEADERBOARD_NAME&%{QUERY_STRING}" [L,NE] + # The following matches the query string and captures it in group %1 for the RewriteRule to use before the fragment + RewriteCond %{QUERY_STRING} "^(.*)$" + RewriteRule ^(/)?$ "http://$HOSTNAME/dashboards/RibDashboard.html?leaderboardName=$LEADERBOARD_NAME&%1" [L,NE] Use Rewrite $IP $PORT @@ -216,7 +218,9 @@ RewriteEngine on RewriteCond %{REQUEST_URI} "^(/)?$" - RewriteRule ^(/)?$ "http://$HOSTNAME/gwt/Home.html?%{QUERY_STRING}#/event/:eventId=$EVENTUUID" [L,NE] + # The following matches the query string and captures it in group %1 for the RewriteRule to use before the fragment + RewriteCond %{QUERY_STRING} "^(.*)$" + RewriteRule ^(/)?$ "http://$HOSTNAME/gwt/Home.html?%1#/event/:eventId=$EVENTUUID" [L,NE] Use Rewrite $IP $PORT @@ -236,7 +240,9 @@ RewriteEngine on RewriteCond %{REQUEST_URI} "^(/)?$" - RewriteRule ^(/)?$ "https://$HOSTNAME/gwt/Home.html?%{QUERY_STRING}#/event/:eventId=$EVENTUUID" [L,NE] + # The following matches the query string and captures it in group %1 for the RewriteRule to use before the fragment + RewriteCond %{QUERY_STRING} "^(.*)$" + RewriteRule ^(/)?$ "https://$HOSTNAME/gwt/Home.html?%1#event/:eventId=$EVENTUUID" [L,NE] Use Rewrite $IP $PORT @@ -251,7 +257,9 @@ RewriteEngine on RewriteCond %{REQUEST_URI} "^(/)?$" - RewriteRule ^(/)?$ "http://$HOSTNAME/gwt/Home.html?%{QUERY_STRING}#/series/:seriesId=$EVENTUUID" [L,NE] + # The following matches the query string and captures it in group %1 for the RewriteRule to use before the fragment + RewriteCond %{QUERY_STRING} "^(.*)$" + RewriteRule ^(/)?$ "http://$HOSTNAME/gwt/Home.html?%1#/series/:seriesId=$EVENTUUID" [L,NE] Use Rewrite $IP $PORT @@ -271,7 +279,9 @@ RewriteEngine on RewriteCond %{REQUEST_URI} "^(/)?$" - RewriteRule ^(/)?$ "https://$HOSTNAME/gwt/Home.html?%{QUERY_STRING}#/series/:seriesId=$EVENTUUID" [L,NE] + # The following matches the query string and captures it in group %1 for the RewriteRule to use before the fragment + RewriteCond %{QUERY_STRING} "^(.*)$" + RewriteRule ^(/)?$ "https://$HOSTNAME/gwt/Home.html?%1#/series/:seriesId=$EVENTUUID" [L,NE] Use Rewrite $IP $PORT @@ -286,7 +296,9 @@ RewriteEngine on RewriteCond %{REQUEST_URI} "^(/)?$" - RewriteRule ^(/)?$ "http://$HOSTNAME/gwt/Home.html#/regatta/overview/:eventId=$EVENTUUID" [L,NE] + # The following matches the query string and captures it in group %1 for the RewriteRule to use before the fragment + RewriteCond %{QUERY_STRING} "^(.*)$" + RewriteRule ^(/)?$ "http://$HOSTNAME/gwt/Home.html?%1#/regatta/overview/:eventId=$EVENTUUID" [L,NE] Use Rewrite $IP $PORT @@ -316,7 +328,9 @@ RewriteEngine on RewriteCond %{REQUEST_URI} "^(/)?$" - RewriteRule ^(/)?$ "http://$HOSTNAME/gwt/Home.html#/event/:eventId=$EVENTUUID" [L,NE] + # The following matches the query string and captures it in group %1 for the RewriteRule to use before the fragment + RewriteCond %{QUERY_STRING} "^(.*)$" + RewriteRule ^(/)?$ "http://$HOSTNAME/gwt/Home.html?%1#/event/:eventId=$EVENTUUID" [L,NE] Use Rewrite 172.31.30.89 8888 @@ -336,7 +350,9 @@ RewriteEngine on RewriteCond %{REQUEST_URI} "^(/)?$" - RewriteRule ^(/)?$ "https://$HOSTNAME/gwt/Home.html#/event/:eventId=$EVENTUUID" [L,NE] + # The following matches the query string and captures it in group %1 for the RewriteRule to use before the fragment + RewriteCond %{QUERY_STRING} "^(.*)$" + RewriteRule ^(/)?$ "https://$HOSTNAME/gwt/Home.html?%1#/event/:eventId=$EVENTUUID" [L,NE] Use Rewrite 172.31.30.89 8888 @@ -352,7 +368,9 @@ RewriteEngine on RewriteCond %{REQUEST_URI} "^(/)?$" - RewriteRule ^(/)?$ "http://$HOSTNAME/gwt/RegattaOverview.html?event=$EVENTUUID" [L,NE] + # The following matches the query string and captures it in group %1 for the RewriteRule to use before the fragment + RewriteCond %{QUERY_STRING} "^(.*)$" + RewriteRule ^(/)?$ "http://$HOSTNAME/gwt/RegattaOverview.html?event=$EVENTUUID&%1" [L,NE] Use Rewrite $IP $PORT @@ -556,4 +574,4 @@ Use Rewrite 172.31.18.218 8888 - \ No newline at end of file +