SSI cannot grab full address only index.php

Started by diontoradan, January 03, 2011, 03:45:50 PM

Previous topic - Next topic

Arantor

It'll need to be on anyway for login status to be preserved between forum and outside it in your site.

And you have absolutely no other mods of any kind installed?

Ant59

Absolutely no mods. And I haven't touched any of the code yet. I just installed the forum. Ok, I'll turn it on.

Ant59

The weird thing is though, that the SSI functions work. It loads ssi_boardNews() and prints to array, but the hyper-links, and images have the wrong url still.

Arantor

Question of the day: when you say the links are being generated as domain.com/index.php?xxxx instead of domain.com/forum/index.php?xxxx, where are you checking this? Are you actually viewing the HTML source that's generated or going purely by the link the browser wants to go to?

Ant59

echo $scripturl;

Outputs

http://67.23.243.193/index.php



And



echo $boardurl;

Outputs

http://67.23.243.193

Arantor

Hrm, so it is actually being generated incorrectly as opposed to being merely empty (which is what I was getting at before)

If you globalise $boardurl and echo that, what do you get? I think I know what's at fault here, I think there's a bug in the way it tries to detect the URL when there's an IP address in it...

Ant59

Yeah that makes sense, though I can't figure out why it would cause a difference in the way the url is written.

I globalised $boradurl. Same result.

(Have to leave this for now. Will be back on here later. Thanks loads for your help so far!)

Arantor

OK, let's try something experimental, this may or may not work and without further testing it may have undesired consequences. As far as I know, though, it should not produce any security issues for your forum - it is all about bringing URLs together rather than protecting for security purposes.

QueryString.php, around line 1468:
if (isset($detected_url) && $detected_url != $boardurl)

Change that to:
if (isset($detected_url) && $detected_url != $boardurl && SMF !== 'SSI')

Ant59

Awesome! It worked :) It was in Load.php, not QueryString.php on line 1468. But it all works great now. Thanks so much for your help!! You're brilliant.

Arantor

Don't know why I thought it was QueryString.php, heh, but yeah that's the one. Let me know if it has any odd side effects, but I don't think it should.

noahlearner

HI all,

This is my first post.  be gentle.

I am trying to integrate SMF with MODX and I have included the ssi like this

<?php
require("forums/SSI.php");
?>


and tried to keep it super simple for testing so I used this below to output the standard most recent posts.
<?php
ssi_recentPosts
();
?>


I want the link for"post title" to point to http hxxp:74.54.206.217/forums/index.php?topic=3.msg3;topicseen#new [nonactive], but it instead points to http 74.54.206.217/~acktri/forums/index.php?topic=3.msg3;topicseen#new

I am running 2.0 rc4, server settings are:
local cookies off, subdomain independent cookies off.

I have friendly urls turned on via url rewrites on MODX.

Many Thanks,

Noah

Arantor

That implies you either have the forum URL set wrong in the admin panel or MODX is broken. SSI functions all use $scripturl which is defined based on $boardurl in Settings.php.

Advertisement: