Last active
January 4, 2016 17:19
-
-
Save samrocketman/8653436 to your computer and use it in GitHub Desktop.
A sample apache rewrite for checking for a gitlab cookie and redirecting a user accordingly. This goes in the gitlab virtualhost before the proxy and after RewriteEngine On..
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#http://httpd.apache.org/docs/2.2/rewrite/intro.html#rewritecond | |
#http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritecond | |
#http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriterule | |
#Use NOT logic. If cookie doesn't exist then redirect. Otherwise, default behavior. | |
RewriteCond %{HTTP_COOKIE} !request_method | |
RewriteCond %{QUERY_STRING} ^$ | |
RewriteRule ^/$ /public/ [NE,R,L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Serve a non-gitlab sub-URL.