Skip to content

Instantly share code, notes, and snippets.

@russellmatbouli
Created November 21, 2016 15:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save russellmatbouli/94e74eb52595c166f4707825ef771faf to your computer and use it in GitHub Desktop.
Save russellmatbouli/94e74eb52595c166f4707825ef771faf to your computer and use it in GitHub Desktop.
Bugzilla PROJECT rewrite rules
# This set of directives sets the PROJECT environment variable.
# Bugzilla uses this to switch configurations for multiple databases
# It matches a request url for a subdirectory called project, then sets
# the value of ENV{PROJECT} to the next directory (alphanumeric only).
RewriteEngine on
RewriteCond %{REQUEST_URI} "^(.*)project"
RewriteRule "project/([a-zA-Z0-9_]+?)/(.*)$" "%1$2" [E=PROJECT:$1]
SetEnvIfExpr "env('REDIRECT_PROJECT') =~ /^([a-zA-Z0-9_]+)$/" PROJECT=$1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment