'Location:' HTTP header variable fixed incorrectly.

Vincent Blondel

Joined: 2006-08-14
Posts: 4
Posted: Mon, 2007-02-19 20:58

Hello all,

I get some problems with my gallery installation. I use Gallery 2.1 on Apache 2.0.59/FreeBSD 6.2 behind a Apache 1.3/mod_proxy/OpenBSD 3.9.

When I browse the site with my URL http://jlang.dyndns.org/gallery, this is working perfectly but when I try to reach it with another URL like http://test.xtra-net.be/cr200422001/gallery/ links are completely broken.

So after a little troubleshooting, I noticed Gallery2 inserts a 'Location' variable in the HTTP header and this is causing lots of problems because URL is moved to http://test.xtra-net.be/gallery/main.php.

After some research on Google I read that it is impossible to rewrite HTTP headers via mod_headers with mod_proxy. Both are incompatible. So I tried to remove this variable on my backend server but this is also not working.

So my question is how can I remove this line so I can browse my site correctly ?

I really would appreciate your help.

Regards.
Vincent

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2007-02-19 21:41

the Location header is nothing special to g2. it's how HTTP redirects (HTTP status code 301 / 302) are done.

G2 autodetects the hostname based on how g2 is accessed and on your webserver's settings (hostname).
if this autodetection is not working correctly for you, you can force the hostname with config.php's baseUri setting.

--------------
Doumentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage

 
Vincent Blondel

Joined: 2006-08-14
Posts: 4
Posted: Tue, 2007-02-20 19:48

Problem is not coming from the hostname but from the path.

If you type http://test.xtra-net.be/cr200422001/gallery you will be redirected to http://test.xtra-net.be/gallery ,

If you type http://test.xtra-net.be/cr200422001/gallery/ you get the same result ...

If you now type http://test.xtra-net.be/cr200422001/gallery/main.php, result is ok until you click on photos but if you still click on something ( Gallery for example ) in the connexion bar, link is broken again.

I cannot understand what happens because I do not have any problem with my own files.

I hope situation is a bit more clear for you ?

Thanks to help me :-)

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2007-02-20 20:15

it's probably a problem with your server's subdomain settings / domain pointers / redirects.

does your config.php have values for baseUri and or galleryBaseUrl? if so, what are those values?

you can fix it by setting the baseUri in config.php to 'http://test.xtra-net.be/cr200422001/gallery/main.php'.

--------------
Doumentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage

 
Vincent Blondel

Joined: 2006-08-14
Posts: 4
Posted: Wed, 2007-02-21 16:06

---
$gallery->setConfig('galleryBaseUrl', '');
$gallery->setConfig('baseUri', 'http://test.xtra-net.be/cr200422001/gallery/main.php');
---

I tried what you proposed to me and this is working but not as an ideal way.

I mean if I type the complete URL as (http://test.xtra-net.be/cr200422001/gallery/main.php) this is working fine but if I type something more usual as

http://test.xtra-net.be/cr200422001/gallery (or)
http://test.xtra-net.be/cr200422001/gallery/

this is not working.

How can such a situation happen that even if I type index.php I cannot reach the website.

Let's take another example, the root of my website automatically redirects to index.xml and you get a blank page.
Another simple example, type /test and you automatically get will get index.php.

These are two simple examples that are correctly proxied without encoding any special configuration file, without getting return code as 302, ....

Why do I not have such a behaviour with Gallery ?

Now, if you look at my gateway configuration, this is not more complicated as :

<VirtualHost *:80>
ServerName test.xtra-net.be
ProxyRequests Off
ProxyPass /cr200422001/ http://hostname/
ProxyPassReverse /cr200422001/ http://hostname/
...
</VirtualHost>

I hope my configuration is now a bit more clear.

Thanks to help me.