Language: 
To browser these website, it's necessary to store cookies on your computer.
The cookies contain no personal information, they are required for program control.
  the storage of cookies while browsing this website, on Login and Register.
Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Select language:

Community



Donate

Donate for PortaMx !
Your donation is safe and helps support the issues and causes you care most about.

Stats

  • *Total Members: 4319
  • *Latest: thygrim

  • *Total Posts: 15781
  • *Total Topics: 2384
  • *Online Today: 4
  • *Most Online: 157
(27.08.09, 03:54:53)
  • *Users: 1
  • *Guests: 2
  • *Total: 3

Author Topic: switching from a domain to another do not deny threads?  (Read 4387 times)

0 Members and 0 Guests are viewing this topic.

Offline luuuciano

  • Jr. Member
  • **
  • Posts: 85
  • Gender: Male
For example...
I was on domain1...  forum AAAAA, thread BBBB...
Domain2 have Forum ZZZZZ , but have not included the AAAAA forum...

To test a thing with the website logo I switched domains, on forum AAAAA, thread BBBB I just changed the url to domain2 (keeping the thread url section).... and the thread was showed... in a domain that have not that forum selected...
The logic says that it may have to show a 404 or something?

pmx subforums works just on boardindex... but in threads it just shows everything everywhere?

Offline feline

  • CO PortaMx corp.
  • Administrator
  • *
  • Posts: 5586
  • Gender: Female
Re: switching from a domain to another do not deny threads?
« Reply #1 on: 01.05.12, 11:48:40 »
pmx subforums works just on boardindex... but in threads it just shows everything everywhere?
Well .. for the current release ... yes. If you know the correct link to a topic in a other subforums, you can show it.
To suppress that it's need additional queries on each topic/message request to filter out the board/cat id.
Many are stubborn in relation to the path, a few in relation to the target.

Offline luuuciano

  • Jr. Member
  • **
  • Posts: 85
  • Gender: Male
Re: switching from a domain to another do not deny threads?
« Reply #2 on: 01.05.12, 18:33:12 »
Thanks for the information!
It is good to know it...

I have no problems with that...
But, it is certainly bad for SEO (and search results too, if the forum do not get banned by google algorythm)...
If any "odd" link is "filtered" outthere and google bot catch it... it will fill its database with dupe content, as all the "odds" links will work/show content...

Offline feline

  • CO PortaMx corp.
  • Administrator
  • *
  • Posts: 5586
  • Gender: Female
Re: switching from a domain to another do not deny threads?
« Reply #3 on: 01.05.12, 21:11:13 »
SubForums have no security between the parts and for Spider it's the best way to disable Guest access to subforums and leave only the main forum open for Guest (and spider) ...
Many are stubborn in relation to the path, a few in relation to the target.

Offline luuuciano

  • Jr. Member
  • **
  • Posts: 85
  • Gender: Male
Re: switching from a domain to another do not deny threads?
« Reply #4 on: 01.05.12, 21:26:41 »
With main forum you mean the one where you will see *all* the forums sections?
(because it is the "real" smf forum)

But doing that maybe members will just start using it or, at least, they can use it that way... instead using the subforums...
My main idea was to set that forum/domain to only admin... or something else

In the other hand... google will catch only those links, people comming from those results will reach that main forum too, instead subforums (that is where the content came from... I mean, from members that post content on subforums, not the main forum)

Offline feline

  • CO PortaMx corp.
  • Administrator
  • *
  • Posts: 5586
  • Gender: Female
Re: switching from a domain to another do not deny threads?
« Reply #5 on: 01.05.12, 21:43:09 »
If the Main forum only for Admins, google can see only the subforums have these guest access.
And .. google see the topic  xyz on subform A, but not the same topic xyz on subforum B .. that is outside the intelligence of googles spider  ;)
Many are stubborn in relation to the path, a few in relation to the target.

Offline luuuciano

  • Jr. Member
  • **
  • Posts: 85
  • Gender: Male
Re: switching from a domain to another do not deny threads?
« Reply #6 on: 01.05.12, 21:48:10 »
Lol, that is for sure...
That is because I named it like "odd link"...
But, anyway, may happen sometime, you never know when, but happens... for example moving threads to other boards? (that contain inner links, on posts... mmmm)
The day google bot catch it... it is done... it will find all the other posibilities spidering to the end of the forum...

Offline feline

  • CO PortaMx corp.
  • Administrator
  • *
  • Posts: 5586
  • Gender: Female
Re: switching from a domain to another do not deny threads?
« Reply #7 on: 02.05.12, 19:10:23 »
I look and find a solution ...
open /Sources/Subforums.php in a editor
find:
Code: [Select]
function Subforums_isAllowed()
{
global $modSettings, $base_boardurl, $boardurl, $user_info, $maintenance;

// Subforum called ?
if($boardurl != $base_boardurl && isset($modSettings['subforums'][$_SERVER['SERVER_NAME']]))
{

add after:
Code: [Select]
// we are on the correct category / board?
$error = false;
if(!empty($_GET['c']) && !in_array($_GET['c'], explode(',', $modSettings['subforums'][$_SERVER['SERVER_NAME']]['cats'])))
$error = 'Category';
elseif(!empty($_GET['board']) && !in_array($_GET['board'], explode(',', $modSettings['subforums'][$_SERVER['SERVER_NAME']]['boards'])))
$error = 'Board';

if(!empty($error))
{
header('HTTP/1.0 404 '. $error .' not found.');
header('Content-Type: text/plain; charset=' . (empty($context['character_set']) ? 'ISO-8859-1' : $context['character_set']));
die('404 - '. $error .' not found.');
}

Try it ...
Many are stubborn in relation to the path, a few in relation to the target.

Offline luuuciano

  • Jr. Member
  • **
  • Posts: 85
  • Gender: Male
Re: switching from a domain to another do not deny threads?
« Reply #8 on: 02.05.12, 20:54:59 »
Weeeeeeeee!

Amazing, as always!
You       are        amazing!

btw, the die message can be changed to anything, it will be continue being a real 404 for spiders... right?

I tried the example described on first post and got a board not found...
When it will show the category not found message? under wich conditions?


ohhhh, btw2... the die message can have information about in wich domain is that thread requested located? so people may know where to go, if for some odd reason reach that point
(I mean with the current information, without doing more queries)

Offline feline

  • CO PortaMx corp.
  • Administrator
  • *
  • Posts: 5586
  • Gender: Female
Re: switching from a domain to another do not deny threads?
« Reply #9 on: 04.05.12, 02:30:29 »
btw, the die message can be changed to anything, it will be continue being a real 404 for spiders... right?
You can put in as you want ...

Quote from: luuuciano
I tried the example described on first post and got a board not found...
When it will show the category not found message? under wich conditions?
On category collapse or unread posts in a category

Quote from: luuuciano
ohhhh, btw2... the die message can have information about in wich domain is that thread requested located?
you can use the php variable $_SERVER['SERVER_NAME']
Many are stubborn in relation to the path, a few in relation to the target.

Offline ahrasis

  • Full Member
  • ***
  • Posts: 109
  • Gender: Male
  • Peace2u
    • ahrasis
Re: switching from a domain to another do not deny threads?
« Reply #10 on: 07.09.12, 03:41:58 »
I look and find a solution ...
open /Sources/Subforums.php in a editor
find:
Code: [Select]
function Subforums_isAllowed()
{
global $modSettings, $base_boardurl, $boardurl, $user_info, $maintenance;

// Subforum called ?
if($boardurl != $base_boardurl && isset($modSettings['subforums'][$_SERVER['SERVER_NAME']]))
{

add after:
Code: [Select]
// we are on the correct category / board?
$error = false;
if(!empty($_GET['c']) && !in_array($_GET['c'], explode(',', $modSettings['subforums'][$_SERVER['SERVER_NAME']]['cats'])))
$error = 'Category';
elseif(!empty($_GET['board']) && !in_array($_GET['board'], explode(',', $modSettings['subforums'][$_SERVER['SERVER_NAME']]['boards'])))
$error = 'Board';

if(!empty($error))
{
header('HTTP/1.0 404 '. $error .' not found.');
header('Content-Type: text/plain; charset=' . (empty($context['character_set']) ? 'ISO-8859-1' : $context['character_set']));
die('404 - '. $error .' not found.');
}

Try it ...
I was just wondering, has this been included in the latest version 1.40? Sorry I have not gone through the newest code yet.

Offline feline

  • CO PortaMx corp.
  • Administrator
  • *
  • Posts: 5586
  • Gender: Female
Re: switching from a domain to another do not deny threads?
« Reply #11 on: 07.09.12, 08:38:16 »
Uhmm .. I forgot that.
Now I added that part of code and text and have updated SubForums on Github ...
Many are stubborn in relation to the path, a few in relation to the target.

Offline ahrasis

  • Full Member
  • ***
  • Posts: 109
  • Gender: Male
  • Peace2u
    • ahrasis
Re: switching from a domain to another do not deny threads?
« Reply #12 on: 07.09.12, 12:14:24 »
Noted. Thank you.