Webmastersite.net
Register Log In

Problem: WSNLinks Installed on Subdomain
WSN Links is not redirecting properly.

Comments on Problem: WSNLinks Installed on Subdomain

ModemGuru


Usergroup: Customer
Joined: Mar 22, 2006

Total Topics: 8
Total Comments: 50
Posted Mar 22, 2006 - 10:16 PM:

Just purchased 3 copies of WSN Links. When logging in or out of WSN Links, which I installed on a subdomain, instead of taking me back to sub.domain.com/index.php, it is taking me to www.domain.com/index.php

Any thoughts on how to fix?
mrowton
Forum Regular

Usergroup: Customer
Joined: Feb 19, 2004
Location: Michigan

Total Topics: 57
Total Comments: 185
mrowton
Posted Mar 23, 2006 - 5:42 AM:

Hi Modem,

Im your admin panel, under system sonfiguration, is the correct value in the directory URL box?

It should be http://sub.domain.com with no slash on the end

ModemGuru


Usergroup: Customer
Joined: Mar 22, 2006

Total Topics: 8
Total Comments: 50
Posted Mar 23, 2006 - 5:54 AM:

Correct.

Directory URL: http://sub.domain.com

Cookie Details:
Domain: sub.domain.com


One thing to note is that on the main screen it shows:

Server Name: www.domain.com

Could that be affecting it?
mrowton
Forum Regular

Usergroup: Customer
Joined: Feb 19, 2004
Location: Michigan

Total Topics: 57
Total Comments: 185
mrowton
Posted Mar 23, 2006 - 7:27 AM:

I just checked an install I have on a subdomain (actually its WSN Forums, but I think it should act the same.) And the server name is listed as sub.domain.com

The only thing I could think of thats WSN related is the directory url. Although you have already looked in your admin panel, maybe you could look directly in the database with phpmyadmin. This field is "dirurl" and its in the settings table. If its not correct then you can change it in phpmyadmin or add the following to the bottom of your config.php

$dirurl = ' http://sub.directory.com';

If the dirurl field is correct in your database then it may be a problem with the way your subdomain is set up. Are you using apache? If so do you have something like the below, note the server name.


<VirtualHost *>
ServerName sub.domain.com
DocumentRoot /home/httpd/htdocs/
</VirtualHost>
ModemGuru


Usergroup: Customer
Joined: Mar 22, 2006

Total Topics: 8
Total Comments: 50
Posted Mar 24, 2006 - 6:02 PM:

In wsnlinks_settings dirurl is also set to:

http://sub.domain.com

In searching for...

mrowton wrote:

<VirtualHost *>
ServerName sub.domain.com
DocumentRoot /home/httpd/htdocs/
</VirtualHost>


I'm having a little trouble. Note: I'm running Apache 2 on an Ensim-based server. I found one of them, and the servername is www.domain.com, if I change it to sub.domain.com it will do that for everything.. hmmm
mrowton
Forum Regular

Usergroup: Customer
Joined: Feb 19, 2004
Location: Michigan

Total Topics: 57
Total Comments: 185
mrowton
Posted Mar 24, 2006 - 7:16 PM:

Do you have a seperate httpd.conf file for each domain/subdomain under
/etc/httpd/conf/virtual/




Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Mar 24, 2006 - 10:35 PM:

Do you also have an install at the www. which could be setting a cookie which is being read at the subdomain (cookie domain being .domain.com)?

No problems with http://links.webmastersite.net .
ModemGuru


Usergroup: Customer
Joined: Mar 22, 2006

Total Topics: 8
Total Comments: 50
Posted Mar 24, 2006 - 10:56 PM:

I only have an install on the subdomain. I think that I had accidentally set the realm for the cookie as www.domain.com at first, but changed it to sub.domain.com and cleared my cookies, restarted my browser and still the same deal. raised eyebrow

Something else to note: I am using the phpBB integration feature. Could this be affecting it at all? (phpbb is running on diffsub.domain.com)
ModemGuru


Usergroup: Customer
Joined: Mar 22, 2006

Total Topics: 8
Total Comments: 50
Posted Mar 24, 2006 - 11:17 PM:

Further troubleshooting as yielded some odd results.

Cleared my cookies and logged into:

http://sub.domain.com/admin/

Clicked logout and it took me to:

http://sub.domain.com/index.php

Which is correct. Logged back into:

http://sub.domain.com/admin/

Then hit logout again, and it took me to:

http://www.domain.com/index.php

Which is incorrect. Cleared my cookies again and logged into:

http://sub.domain.com/admin/

and hit logout, and again it took me to the correct address of:

http://sub.domain.com/index.php

hmm..
ModemGuru


Usergroup: Customer
Joined: Mar 22, 2006

Total Topics: 8
Total Comments: 50
#10 - Quote - Permalink
Posted Mar 24, 2006 - 11:25 PM:

More testing:

It looks like while navigating the "returnto" spot in the cookie changes from page to page. Sometimes it has it set to just "returnto" index.php, others it is to other pages. However when going to the main page it sets the "returnto" to goto www.domain.com/index.php , thus hitting logout sends you to www.domain.com/index.php
ModemGuru


Usergroup: Customer
Joined: Mar 22, 2006

Total Topics: 8
Total Comments: 50
#11 - Quote - Permalink
Posted Mar 24, 2006 - 11:36 PM:

Sorry for the streaming "revelation" of posts, but I think I've narrowed down to where the issue is that I am running into. This line is where I'm getting hung up on:

$currenturl = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'];

-but-, that is inside of the following if statement:

if ($settings->dirurl == '')

so if dirurl isn't blank, it shouldn't run:

$currenturl = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'];

should it? Also, do you know where it draws "$_SERVER['SERVER_NAME']"? I'm wondering if maybe I could just clear this all up by removing $_SERVER['SERVER_NAME'] and putting sub.domain.com in it's place. My only hesitation to do that is for upgrading and such. Would like to try using the best workaround available, rather than something my non-php/mysql-related-brainpower can come up with. ;-)
ModemGuru


Usergroup: Customer
Joined: Mar 22, 2006

Total Topics: 8
Total Comments: 50
#12 - Quote - Permalink
Posted Mar 24, 2006 - 11:48 PM:

Fixed? Appears so. I did a find and replace.

I replaced all instances of:

SERVER_NAME

with:

HTTP_HOST

and these changes occurred in:

download.php
finlefunctions.php
index.php

It now appears that everything is working fine now. My one question though, is whether or not this could hinder other operations? Could this make my downloads hotlinkable, etc, or will HTTP_HOST be fine in place of SERVER_NAME for these instances?
mrowton
Forum Regular

Usergroup: Customer
Joined: Feb 19, 2004
Location: Michigan

Total Topics: 57
Total Comments: 185
mrowton
#13 - Quote - Permalink
Posted Mar 25, 2006 - 5:51 AM:

Good job Modem, you'll have to give show us the site when you get it all set up smiling face
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
#14 - Quote - Permalink
Posted Mar 27, 2006 - 3:02 AM:

Since it seems to differ by host, for 3.3.12 the directory url value will override SERVER_NAME whenever set (there will be instances of SERVER_NAME still for the case in which it isn't set yet by that point in the script, but I don't believe that will be causing a problem).
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.