VIRTUAL_URL
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zope 2 |
Invalid
|
Medium
|
Unassigned |
Bug Description
On Zope-CMF Alexander Limi wrote:
[...]
> I investigate the options i have, noting that no variable seems to keep
> the actual URL that is *inside the fecking URL bar* in my browser.
>
> I turn to Simon Eisenmann for help, he comes up with an idea of using a
> combination of SERVER_URL and PATH_TRANSLATED to construct the actual
> URL we're at.
>
> But guess what? This doesn't work in Virtual Hosting scenarioes. So we
> have to create an additional rule that gets rendered if you have a
> Virtual Hosted system.
>
> The rule ends up looking like this:
>
> <a
> tal:define="url
> request/
> tal:attributes=
>
>> Skip to content</a>
>
>
> Easy, right?
[...]
I think this is a bug. VIRTUAL_URL should always be available. This would make it much easier to use:
<a tal:attributes=
> Skip to content</a>
While I'm tempted just to out-and-out reject this, my name isn't Andreas ;-)
Why not just use here/absolute_url or container/ absolute_ url, depending on what it is you actually want to do?
Any code that uses a fixed string URL like SERVER_URL or VIRTUAL_URL is gonna be pretty fragile...