Apache Chief
August 25, 2006 1:04 PM   Subscribe

I have an Apache Web Server running on port 80. I have a Lotus Notes Web Server running on port 81. When a user enters one of my domain names, like www.foobar.com, I would like Apache to redirect to the following www.foobar.com:81/FOOBAR/home.nsf ( All of my Lotus databases will be called home.nsf ). Essentially I want Apache to point to a directory that corresponds to the domain name which will contain the file home.nsf, and make that request on port 81. Any mod_rewrite gurus out there? Another example would be a user entering www.kungfu.com and actually going to www.kungfu.com:81/KUNGFU/home.nsf.
posted by jasondigitized to Technology (9 answers total)
I think what you're interested in is proxying, not mod_rewrite.
posted by evariste at 1:10 PM on August 25, 2006

As far as I know you'd need to set up a RewriteRule in each virtual host config you've got set up (i.e. one for each domain). It might be possible to specify this for all domains, but I'm unsure.

So something like:

RewriteEngine on
RewriteRule ^(.*) http://www.foobar.com:81/FOOBAR/home.nsf [P]

should work, although I'm unsure how you want to deal with requests such as 'http://www.foobar.com/something/else/' - should they turn into 'http://www.foobar.com:81/FOOBAR/home.nsf/something/else/'? I'm unsure what URL structure Lotus Notes uses.

Note that the [P] means to Proxy the requests, so the user's browser will still think it's talking to foobar.com:80/. If you don't care about that, just get rid of the [P].
posted by cyrusdogstar at 1:12 PM on August 25, 2006

RewriteEngine On
RewriteCond %{SERVER_PORT} !^81$
RewriteRule ^(.*)$ http://www.foobar.com:81/FOOBAR/home.nsf [L,R]

posted by Blazecock Pileon at 1:15 PM on August 25, 2006

Yea, Blazecock reminded me that if you are somehow running both items off the same virtual host settings (i.e. this vhost is bound to both 80 AND 81) you'll need the RewriteCond in order to prevent the rule from applying to the rewritten URL (yay infinite loops!).
posted by cyrusdogstar at 1:28 PM on August 25, 2006

Somewhat related previous AskMe: Can apache redirect to another port without displaying the port?
posted by fishfucker at 1:51 PM on August 25, 2006

As an FYI:
Once you get the Apache redirect working, you'll need to configure the Notes server to accept the incoming connections too. If Notes is named anything other than www.foobar.com (from your example), you'll need to create a Web Site configuration doc in the Address Book.
From the Notes directory, go to Configuration...Web...Internet Sites. Click the Add Internet Site...Web button. Fill in "www.foobar.com" in the "Host names or addresses mapped to this site" field.
Now switch to the Configuration tab and make sure that the Home URL is pointing to the correct database.
This is assuming you're running Domino 7. Earlier versions will look a little different.
Check the online help on your Administator client if you run into trouble. They outline it pretty well.
posted by Eddie Mars at 2:02 PM on August 25, 2006

you'll need to create a Web Site configuration doc in the Address Book

I am so glad I don't work with Notes...
posted by feloniousmonk at 1:25 PM on August 26, 2006

Recent similar question
posted by Sharcho at 7:51 PM on August 26, 2006

feloniousmonk, ah it's not so bad. He only has to do all that if we wants more than one domain hosted on the same box. If he only has one site, it'll just work by default.

Wait, what am I saying? Notes is really, really hard, and you should pay me lots of money to maintain it.
posted by Eddie Mars at 1:33 PM on August 27, 2006

« Older Babymama drama, linguistic.   |   Is magnetism magic or what? Newer »
This thread is closed to new comments.