PDA

View Full Version : Base URL doesn't play nicely with subdomains?


Lynne
09-26-2008, 06:28 PM
I recently copied my live site to my test site to do a test upgrade to 3.7.3. All went well but now I'm playing with updating all the templates. One thing I was hoping to change was how I've always had to put full paths in the navbar because of my site setup. I have a main page at www.mysite.org/index.php and then I have my forums at www.mysite.org/forums/. The main home page at www.mysite.org/index.php is a basic vb looking page where I just post some site news and then some recent threads on the bottom. It has the basic vb navbar template and if I left the navbar at default, it would link to member.php and search.php etc. and none of those exist in that directory, so I always went in and changed the paths to "/forums/member.php" and "/forums/search.php" etc. That worked fine for most things but was always a PITA. So, I saw a post by Dismounted suggesting I add the following line in the headinclude template:
<base href="http://test.mysite.org/forums/" />I did that and then I noticed that when I was on my forums, even though the page source would say the link was to "test.mysite.org/forumdisplay.php", if I clicked on it, it would go to "www.mysite.org/forumdisplay.php"!?! Same thing if I went to a forumdisplay.php page and clicked on a link to a showthread.php page - even though the page source said "test.mysite.org/forums/showthread.php", I ended up on my live site. So, I took that base tag out of the headinclude and all was fine again.

I have now just added the base tag into my home page (head section) at www.mysite.org/index.php and am getting the same problem with all the links to showthread pages there (and links to member pages there). As I said, the page source is fine, hovering over the link says it will go to my test site, but clicking on the link takes me to my live site. The only htaccess I have in my test subdomain is to password protect the test site (per the vb agreement). Can someone explain what I'm doing wrong here?

SEOvB
09-26-2008, 11:04 PM
What do you have your paths set to in the adminCP

AdminCP -> vBulletin Options -> Sitename URL Contact Details -> Forum URL

It should be http://www.mysite.org/forums if using your above example and your Homepage URL should be http://mysite.org/index.php

Lynne
09-26-2008, 11:54 PM
What do you have your paths set to in the adminCP

AdminCP -> vBulletin Options -> Sitename URL Contact Details -> Forum URL

It should be http://www.mysite.org/forums if using your above example and your Homepage URL should be http://mysite.org/index.php
That is exactly what I have. (Well, for my test site, it says test.mysite.org, not www.mysite.org.)

SEOvB
09-27-2008, 12:14 AM
Hmm, thats strange, i've always put my forums in /forums like you, and ust entered that path there and never had an issue, you can always try to prefix $bboptions[bburl]/ to the links (i think that variables right, not 100% sure on it)

ex:

$bboptions[bburl]/usercp.php

Lynne
09-27-2008, 12:46 AM
Oh, I know how I can add either /forums or $vboptions[bburl]/ in front of the link, but I was hoping to avoid that. Here is the thread where I brought this up before in response to someone else's question - Chdir/$vbulletin->options['homeurl'] trouble. (https://vborg.vbsupport.ru/showthread.php?t=189817&highlight=base) The OP talks about how he has to change his navbar links (in post 1 & 5), I respond saying I have the same setup and I have to do that also (post 3), and then Dismounted talks about using the base tag instead (in post 6). But, as I said in my first post, instead of the links going to my test site (like the hover url says they will), it is going to my live site. The only thing I can think of is that my test site is setup as a subdomain.