New and Improved 3.13 Beta. Highlights: Shareable filters and dashboards and lots of other goodies. Any feedback can be raised as JIRA issues in the JIRA project.
Issue Details (XML | Word | Printable)

Key: CONF-3343
Type: Improvement Improvement
Status: Open Open
Priority: Minor Minor
Assignee: Unassigned
Reporter: Peter Johnson
Votes: 4
Watchers: 6
Operations

If you were logged in you would be able to see more operations.
Confluence

Domain to space mapping

Created: 01/Jun/05 08:38 PM   Updated: 01/Jun/05 08:38 PM
Component/s: None
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

Participants: Peter Johnson
Since last comment: 3 years, 12 weeks, 5 days ago
Labels:


 Description  « Hide
The idea is to allow access to a space via a domain cleanly so that Confluence becomes a sort of CMS. Currently one could just forward the entire url e.g. /confluence/display/<space>/<page> to the Confluence app however it would be nice if <domain>/<page> could be the URL instead.

I have managed to get some of the way along with the following Apache rewrite, using mod_jk2 to forward to Tomcat with Confluence installed as /. I have a mapping file to translate the domain name into a space key.

RewriteEngine on

  1. Set map to convert to lowercase
    RewriteMap lowercase int:tolower
  2. Set map type and path
    RewriteMap vhost txt:/etc/apache2/maps/vhost
  3. HTTP_HOST not blank
    #RewriteCond %{HTTP_HOST} !^$
    # Convert HTTP_HOST to lowercase
    RewriteCond ${lowercase:%{HTTP_HOST}|NONE} ^((dev|stage)\.)?(.+)$
  4. Search for host in vhost map
    RewriteCond ${vhost:%3} ^(.*)$
  5. Prefix path with vhost search result and set environment variable "VHOST"
    RewriteRule ^(.*)$ $1 [E=VHOST:${lowercase:%{HTTP_HOST}},E=SPACE:%1]

RewriteRule ^/display/\w+(/?.*) $1 [R,L]
RewriteRule ^/display/(~.*) /user/$1 [R,L]
RewriteRule ^/$ /Home
RewriteRule ^/(styles/.*)$ /$1?spaceKey=%{ENV:SPACE} [QSA,PT,L]
RewriteRule ^/user/(~.*)$ /display/$1 [PT,L]
RewriteRule ^/(decorators|pages|images|spaces|download|x|rpc|admin)(/(.*))?$ /$1/$3 [PT,L]
RewriteRule ^/(.\.action.)$ /$1 [PT,L]
#RewriteRule ^(/display/%{ENV:SPACE})?/(.*)$ /display/%{ENV:SPACE}/$2 [PT,L]
RewriteRule ^/(.*)$ /display/%{ENV:SPACE}/$1 [PT,L]

It would be nice if this could be done a little cleaner e.g. pass the space key as a querystring parameter to every request or prefix every URI with the space key e.g.
/display/Home?spaceKey=<space> or
/<space>/display/Home or
/styles/<space>/Home



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.