Index: [Article Count Order] [Thread]

Date:  Wed, 13 Jun 2007 01:25:59 +0200
From:  Michael Stauber <bq (at mark) solarspeed.net>
Subject:  [coba-e:10096] Re: /admin rewrite rule
To:  coba-e (at mark) bluequartz.org
Message-Id:  <200706130126.00364.bq (at mark) solarspeed.net>
In-Reply-To:  <1486c6440706121533k6682d755t131f9b0d3fe73750 (at mark) mail.gmail.com>
References:  <1486c6440706121533k6682d755t131f9b0d3fe73750 (at mark) mail.gmail.com>
X-Mail-Count: 10096

Hi Adam,

> I am setting up Drupal (http://drupal.org) on one of my vsites.  In
> drupal they use /admin as for administering the site.  Is there a way
> to disable the BQ re-write rule so /admin is passed to the site
> instead of being caught by the webserver config?

/etc/httpd/conf.d/bluequartz.conf

Near the top of that file you see this entries:

RewriteEngine On
RewriteCond %{HTTP_HOST}                ^([^:]+)
RewriteCond %{DOCUMENT_ROOT}            !-d
RewriteRule .*                          http://%1:444/error/forbidden.html 
[L,R]
RewriteCond %{HTTP_HOST}                ^([^:]+)
RewriteRule ^/admin/?$                  http://%1:444/login.php [L,R]
RewriteCond %{HTTP_HOST}                ^([^:]+)
RewriteRule ^/siteadmin/?$              http://%1:444/login.php [L,R]
RewriteCond %{HTTP_HOST}                ^([^:]+)
RewriteRule ^/personal/?$               http://%1:444/login.php [L,R]
RewriteCond %{HTTP_HOST}                ^([^:]+)
RewriteRule ^/login/?$                  http://%1:444/login.php [L,R]

So /admin, /siteadmin, /personal and /login are all redirected to the standard 
login page. Simply comment out  ...

RewriteRule ^/admin/?$                  http://%1:444/login.php [L,R]

... AND the line ...

RewriteCond %{HTTP_HOST}                ^([^:]+)

... that's directly above it. Then restart Apache for the change to take 
effect.

So in total that section would then look like this:

RewriteEngine On
RewriteCond %{HTTP_HOST}                ^([^:]+)
RewriteCond %{DOCUMENT_ROOT}            !-d
RewriteRule .*                          http://%1:444/error/forbidden.html 
[L,R]
#RewriteCond %{HTTP_HOST}                ^([^:]+)
#RewriteRule ^/admin/?$                  http://%1:444/login.php [L,R]
RewriteCond %{HTTP_HOST}                ^([^:]+)
RewriteRule ^/siteadmin/?$              http://%1:444/login.php [L,R]
RewriteCond %{HTTP_HOST}                ^([^:]+)
RewriteRule ^/personal/?$               http://%1:444/login.php [L,R]
RewriteCond %{HTTP_HOST}                ^([^:]+)
RewriteRule ^/login/?$                  http://%1:444/login.php [L,R]


-- 
With best regards,

Michael Stauber
http://www.solarspeed.net