• Welcome to Simple Machines Community Forum. Please login or sign up.

Mambo with SEO and SMF

Started by Ritchie, February 22, 2005, 09:57:10 AM

Previous topic - Next topic

Ritchie

Hi,

I test Mambo 4.5.1, SMF 1.0.2 and MOS_SMF_Bridge 3.01 on my local network. It doesn't work, if SE in Mambo is turned on. The forum is wrapped. I can switch from Mambo-menu to the forum in both cases, with SE on and off. But a click on a board-link (for example) with SE on causes an error.

The address is
SEO off: hxxp:saeger-in-web.local/index.php?option=com_smf&Itemid=95&board=1.0 [nonactive]
SEO on : hxxp:saeger-in-web.localhttp/ [nonactive]/sager-in-web.local/component/option,com_smf/Itemid,95/board,1.0/lang,de/

Sure, server hxxp:saeger-in-web.localhttp [nonactive] can't be found, the address is wrong. Where are the addresses parsed?

I'd like to publish a forum on my site hxxp:www.saeger-in-web.de [nonactive], but I can't do without SE.

Any help appreciated.

crashdummy

components/com_smf/smf.php
around line 109:
from
$sefurl[] = str_replace($_SERVER['HTTP_HOST'], $_SERVER['HTTP_HOST'].$mosConfig_live_site, sefRelToAbs( $nonsefurl ));
to
$sefurl[] = str_replace($_SERVER['HTTP_HOST'].$mosConfig_live_site, $_SERVER['HTTP_HOST'],  sefRelToAbs( $nonsefurl ));

Ritchie

Quote from: crashdummy on February 22, 2005, 10:11:53 AM
components/com_smf/smf.php
around line 109:
from
$sefurl[] = str_replace($_SERVER['HTTP_HOST'], $_SERVER['HTTP_HOST'].$mosConfig_live_site, sefRelToAbs( $nonsefurl ));
to
$sefurl[] = str_replace($_SERVER['HTTP_HOST'].$mosConfig_live_site, $_SERVER['HTTP_HOST'],  sefRelToAbs( $nonsefurl ));

Yes, it works fine, now.

Thank you very much!

sniffers

February 23, 2005, 02:55:08 AM #3 Last Edit: February 23, 2005, 03:19:04 AM by sniffers
Hi,

This has fixed the links, but it seems to have broken the stylesheet - can anyone tell me where that's referenced??

this is the problem stylesheet - it's referenced relative??

<script language="JavaScript" type="text/javascript" src="http://www.wag-uk.org.uk/forum/Themes/default/script.js"></script>
<script language="JavaScript" type="text/javascript"><!--
var smf_theme_url = "http://www.wag-uk.org.uk/forum/Themes/default";
var smf_images_url = "http://www.wag-uk.org.uk/forum/Themes/themis/images";
// --></script>
<title>WAG UK - Index</title>
<style type="text/css"><!--
.code
{
white-space: pre;
}
--></style>
<link rel="stylesheet" type="text/css" href="Themes/default/style.css" />


Cheers

Tiff

sniffers

February 23, 2005, 04:04:09 AM #4 Last Edit: February 23, 2005, 05:16:48 AM by sniffers
OK, the stylesheet is not the only thing that's affected, I can't change admin settings either...

this is the URL I get if I try and board into maintenance mode whilst SEO is switched on..

http://www.wag-uk.org.uk/mambo/component/option,com_smf/Itemid,62/ [nofollow]/action=modsettings2

as opposed to

http://www.wag-uk.org.uk/mambo/index.php?option=com_smf&Itemid=62&?action=modsettings;sesc=.. [nofollow]

:'(

more..

cannot add topics - URL = http://www.wag-uk.org.uk/mambo/component/option,com_smf/Itemid,62 [nofollow]//action=post2;start=0;board=10

Ooooh entities aren't being parsed either... Nurse! It&039;s time for Tiff&039;s medicine.....

arg!

I guess it's this regexp bit ere??

function ob_fixurls($buffer)
{

     global $scripturl, $mosConfig_live_site, $mosConfig_sef;

$buffer = str_replace('?board', 'board' , $buffer);
$buffer = str_replace('?topic', 'topic' , $buffer);
$buffer = str_replace('?action', 'action' , $buffer);
$buffer = str_replace('action=login2', 'action=mambo_login' , $buffer);
$buffer = str_replace('action=logout', 'action=mambo_logout' , $buffer);
$buffer = str_replace($scripturl.'&action=register', $mosConfig_live_site.'/'.basename($_SERVER['PHP_SELF']).'&option=com_smf_registration&task=register' , $buffer);

if ($mosConfig_sef == '1'){
          $regexa = "/href=\"(.*?)\"/s";
          preg_match_all( $regexa, $buffer, $smfurl );
          $sefurl = array();
          $regex = array();
          $smfurl[1] = array_unique($smfurl[1]);
          arsort($smfurl[1]);
          reset($smfurl[1]);
          foreach($smfurl[1] as $nonsefurl) {
         $pos = strpos($nonsefurl,$mosConfig_live_site);
         if ($pos >= 0) {
       $regex[] = "/". preg_quote ($nonsefurl, "/")."/";
       $pos = $pos + strlen($mosConfig_live_site) + 1;
       $nonsefurl = substr($nonsefurl, $pos);
       $nonsefurl= str_replace("&amp;","&",$nonsefurl);
       $nonsefurl= str_replace("&?","&",$nonsefurl);
       $nonsefurl= str_replace(";","&",$nonsefurl);
       if (substr($mosConfig_live_site,4)!="http"){
        $sefurl[] = str_replace($_SERVER['HTTP_HOST'].$mosConfig_live_site, $_SERVER['HTTP_HOST'],  sefRelToAbs( $nonsefurl ));
               } else {
         $sefurl[] = sefRelToAbs( $nonsefurl );
               }
}
          }
          $buffer = preg_replace($regex,$sefurl,$buffer);
        }
return $buffer;
}


???

my regexp is poor, and I'm not entirely sure what it's supposed to say which doesn't help!! (  :-[ )

Advertisement: