"""
For clarification, are you asking for a way to have a base tag with
your url(s) on every notebook page and that's all we need for url
prefixes?
"""

Yes. In the head of every page, include a <base> tag, such as:
<base href="/sage" />

Then, each of the links on the page will be interpretted by the
browser as relative to /sage.
So, <a href="/home/admin"> would be a link to /sage/home/admin.

Now that I think of it, you'd also need to modify redirects.

"""
how is mod_python support going to help you?
"""

You can tell mod_python to map a specific location (like /sage) to
sage (or any other mod_python handler). For example, the following
directive in an httpd.conf file:

<Location /mywiki>
    SetHandler python-program
    # Add the path of your wiki directory
    PythonPath "['/var/www/moin/mywiki'] + sys.path"
    PythonHandler MoinMoin.request.request_modpython::Request.run
</Location>

Would cause all /mywiki/* links to be sent through
MoinMoin.request.request_modpython.Request.run()

My current solution is:

"""
Could you do this by running them on different ports and using some
mod_rewrite magic?  Not to say that that is the right solution, but
may
be a possibility...
"""

RewriteRule ^(.*)$ http://localhost:5463/$1 [P]

So, I just proxy all requests to /sage/.* to localhost:5463/.*

That would work, except that sage uses absolute links. So while <a
href="/home/admin" /> was supposed to mean http://localhost:5463/home/admin,
thus /sage/home/admin, the browser (which has no idea that I'm
proxying this stuff) thinks that means /home/admin.
And since I'm only redirecting /sage/.*, /home/admin is a 404.

So rewriting works, but only for the superficial problem. Using links
that are absolute, however, prevents rewrite from being useful.

So yes, if a <base href="${configuration_variable}" /> were in the
<head> of every page, and if redirects were modified to be $
{configuration_variable}/${url}, sage would work well in a url prefix
(obviously, one would also need to add a configuration variable/
argument to notebook() that would be the contents of the <base> tag.
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to