1

I'm trying to set up Zenoss to work with https://server/zenoss instead of https://server. Here's my rewrite rule:

RewriteEngine On
RewriteRule ^/zenoss($|/.*) http://localhost:8080/VirtualHostBase/https/server:443/VirtualHostRoot/zenoss$1 [L,P]

This way doesn't work. I get:

Site error

An error was encountered while publishing this resource. The requested resource does not exist. Please click here to return to the Zenoss dashboard

The url for "Please click here to return to the Zenoss dashboard" points to https://server/zport/dmd

However, it does work if I do it the standard Zenoss/Plone/Zope way:

RewriteEngine On
RewriteRule ^/(.*) http://localhost:8080/VirtualHostBase/https/server:443/VirtualHostRoot/$1 [L,P]

... it works great.

According to this article, it seems like the first way should work. I'm not really sure what I'm missing.

churnd
  • 4,077
  • 5
  • 34
  • 42

1 Answers1

1

You've got an extra zenoss in your first RewriteRule (and you're also doubling up on slashes). It reads:

RewriteRule ^/zenoss($|/.*) http://localhost:8080/VirtualHostBase/https/server:443/VirtualHostRoot/zenoss$1 [L,P]

It should be:

RewriteRule ^/zenoss($|/.*) http://localhost:8080/VirtualHostBase/https/server:443/VirtualHostRoot$1 [L,P]
BMDan
  • 7,249
  • 2
  • 23
  • 34
  • Thanks, but I'm still getting redirected to https://server/zport/dmd with that rule. – churnd May 10 '11 at 02:56
  • You aren't trying to do this in a .htaccess, are you? If not, fire up some rewrite logging and figure out what's going in and what's coming out of the RewriteRule. – BMDan May 14 '11 at 00:37
  • No, I'm putting it in the apache configuration file. The only thing I can see in the Apache error logs is: [Mon May 23 11:40:17 2011] [error] [client 10.8.1.40] File does not exist: /var/www/html/zenoss [Mon May 23 11:40:17 2011] [error] [client 10.8.1.40] File does not exist: /var/www/html/favicon.ico – churnd May 23 '11 at 15:42
  • How about: `RewriteRule ^/zenoss($|/.*) http://localhost:8080/VirtualHostBase/https/server:443/VirtualHostRoot/$1 [L,P]`. If this doesn't work, either turn on RewriteLog, or do a manual request (e.g. `links 'http://localhost:8080/VirtualHostBase/https/server:443/VirtualHostRoot/'`). – BMDan May 24 '11 at 01:04
  • That rewrite rule didn't work either. I get the same error. I don't know how to turn on RewriteLog. The manual request works directly on the server. – churnd May 24 '11 at 15:12
  • http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#RewriteLog – BMDan May 31 '11 at 02:20