0

我正在使用 Oracle apache,每当有应用程序维护活动时,我都会将应用程序指向维护页面,以便在此期间尝试访问应用程序的用户会看到维护页面。有多个应用程序,我想显示除特定应用程序/url 之外的所有应用程序的维护页面。我试图从重定向中排除该特定 URI,但是有问题。我检查了类似的线程讨论,但无法弄清楚它的工作语法。下面是代码。

ErrorDocument 503 http://<hostname>:7777/holdingpage/holdingpage-deploy.html

<IfModule mod_rewrite.c>
  RewriteEngine on
  Header always set Retry-After "3600"

# Always allow REIM application
#  RewriteRule ^/ReimViewController http://<hostname>:7777/ReimViewController/faces/Home [R,L]

# Allow access to RESA and CPM applications for testing by setting the respective cookies.
  RewriteRule ^/allowtestingReSA http://<hostname>:7777/ResaPortal/faces/Home [L,R,CO=allowtestingReSA:true:<hostname>:240]
  RewriteRule ^/endtestingReSA http://<hostname>:7777/ResaPortal/faces/Home [L,R,CO=allowtestingReSA:false:<hostname>:-1]

  RewriteRule ^/allowtestingCPM http://<hostname>:7777/CPM/faces/Home [L,R,CO=allowtestingCPM:true:<hostname>:240]
  RewriteRule ^/endtestingCPM http://<hostname>:7777/CPM/faces/Home [L,R,CO=allowtestingCPM:false:<hostname>:-1]

  RewriteCond %{HTTP_COOKIE} !allowtestingReSA=.*
  RewriteCond %{HTTP_COOKIE} !allowtestingCPM=.*
  RewriteCond %{REQUEST_URI} !holdingpage/*
  RewriteCond %{REQUEST_URI} !^/ReimViewController

  RewriteRule .* . [L,R=503]
  RewriteCond %{REQUEST_METHOD} ^OPTIONS
  RewriteRule .* . [F]
</IfModule>

我在下面添加以排除 REIM 应用程序的 URI,但它似乎无法正常工作,因为它被重定向到维护页面。

RewriteCond %{REQUEST_URI} !^/ReimViewController

我尝试了不同的选项,例如 !ReimViewController/* !^/ReimViewController/* !^/ReimViewController/faces/Home$ 甚至完整的 URL,但似乎不起作用。

我也尝试了下面的重写(在代码上面有评论),我确实观察到它在几天前工作但它没有工作,因为它因 err_too_many_redirects 失败

RewriteRule ^/ReimViewController http://<hostname>:7777/ReimViewController/faces/Home [R,L]

任何修复它的指针表示赞赏。谢谢。

4

0 回答 0