Can you make WeBWork use only relative URLs?

Can you make WeBWork use only relative URLs?

by Justin Brody -
Number of replies: 2
This is a pretty technical question and not very important; I hope no-one will spend too much valuable time on it unless there's a quick answer.

I'm running WeBWork on the local network of my campus. In particular, if a student wants to access it from off-campus they need to go through the VPN. We don't have a lot of spare IP addresses, so our IT department hasn't wanted to give me one.

As a sort of workaround, a colleague set up his server so that requests to a subdirectory will come from my machine. For example, if someone requests

from off-campus it would pull the same page as requesting
from on-campus.

So far, so good. The problem is that when you login, WeBWork seems to send a request for /webwork2/
This ends up looking for http://friends.machine/webwork2/ which doesn't exist. So I'm wondering if there's a reasonably easy way to get WeBWork to only use relative URLs, so that it would request the proper URL for someone coming from either on-campus (http://my.machine/webwork2/) or off-campus (http://friends.machine/my_machine/webwork2/)

Again, this isn't a big deal but it would be nice if I could get it working...

In reply to Justin Brody

Re: Can you make WeBWork use only relative URLs?

by Danny Glin -
A workaround occurred to me:

You could change the root url of WeBWorK to be my_machine/webwork2/.  Thus requests from both on-campus and off-campus would be headed for http://either_server/my_machine/webwork2/

Of course this would mean updating all existing links and bookmarks, but it seems like it should be seamless once it's set up.

In reply to Justin Brody

Re: Can you make WeBWork use only relative URLs?

by Gavin LaRose -
Hi Justin,

My first thought is that what you really want to do is use mod_proxy in apache on your friend's server. I think the ProxyPass directive (and ProxyPassReverse) will let you do what you want.

From what you said it sounds as if you're doing essentially this already, but I'm not sure. I didn't carefully reread the apache documentation, but I think that the ProxyPassReverse directive should let you rewrite the URL that's coming back from your server when it's returned from your friend's.