Home arrow Forum How to avoid visit the forum by www.domain.com/smf ?
  Welcome, Guest. Please login or register.
Did you miss your activation email?
December 03, 2008, 03:51:52 AM
Home New Posts Search Calendar


Login with username, password and session length
+  Joomla Forum
|-+  Joomla Hacks
| |-+  Joomla-SMF Forum Support
| | |-+  Joomla-SMF 2.0.x (Moderators: -Wolverine, kai920)
| | | |-+  How to avoid visit the forum by www.domain.com/smf ?
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Print
Author Topic: How to avoid visit the forum by www.domain.com/smf ?  (Read 1956 times)
baijianpeng
Joomla Newbie
*

Karma: +0/-38
Offline Offline

Posts: 46


JoomlaGate.com


View Profile
How to avoid visit the forum by www.domain.com/smf ?
« on: November 22, 2006, 01:44:58 PM »

Thanks to Joomlahacks team I successfully set up my forum with this JSMF bridge. I used the wrapped mode. You can see it work well at http://www.joomlagate.com .

But I also noticed that I can visit my forum by http://www.joomlagate.com/smf . This will jump out the control of this bridge as well as my preference.

How to avoid this ? Do I need something like a redirect ?

Thank you !
Logged

JoomlaGate - Open the gate to the World of Joomla!

http://www.joomlagate.com
p9939068
Joomla Expert
****

Karma: +18/-5
Offline Offline

Posts: 173


View Profile WWW
Re: How to avoid visit the forum by www.domain.com/smf ?
« Reply #1 on: November 22, 2006, 01:50:30 PM »

Thanks to Joomlahacks team I successfully set up my forum with this JSMF bridge. I used the wrapped mode. You can see it work well at http://www.joomlagate.com .

But I also noticed that I can visit my forum by http://www.joomlagate.com/smf . This will jump out the control of this bridge as well as my preference.

How to avoid this ? Do I need something like a redirect ?

Thank you !
You can set up a simple redirect using .htaccess but i do not recommend this. There have been many issues regarding administrating the forum in wrapped mode (mostly template related), so there may be cases where you'll need to go to the original smf path (www.domain.com/smf/index.php&action=admin) to make changes.

You need an apache server to set up a .htaccess redirect. More help at http://httpd.apache.org/docs/1.3/howto/htaccess.html
« Last Edit: November 22, 2006, 01:52:17 PM by p9939068 » Logged

-----
Owner of http://mike.simbunch.com
Creator of ParaInvite, AJAX Sandbox, AJAX SMF Polls, Profile URL etc..
-Wolverine
Moderator
Joomla Guru
*****

Karma: +376/-34
Offline Offline

Posts: 3393


Lead Developer


View Profile WWW
Re: How to avoid visit the forum by www.domain.com/smf ?
« Reply #2 on: November 22, 2006, 02:29:44 PM »

you can also put this code in your SMF index.php:

Code:
// Redirect users who try to access /forum directly
if (strpos($_SERVER['QUERY_STRING'], 'dlattach') === false && strpos($_SERVER['QUERY_STRING'], 'verificationcode') === false)
{
        if(!defined('_VALID_MOS')){ header("Location: /index.php?option=com_smf&Itemid=yourItemidNum&".$_SERVER['QUERY_STRING']);}}
}

this was written by Kindred at simplemachines.org
http://www.simplemachines.org/community/index.php?topic=81152.msg541379#msg541379
« Last Edit: November 22, 2006, 02:31:59 PM by -Wolverine » Logged

Need help?  Check Here First!
Get the JSMF User Guide
SEARCH this forum.
Taj Shah
Joomla Newbie
*

Karma: +0/-0
Offline Offline

Posts: 3


View Profile
Re: How to avoid visit the forum by www.domain.com/smf ?
« Reply #3 on: February 01, 2007, 08:37:13 AM »

This seems the appropriate place to post this.

I have noticed that with my site, when I am logged into the front end, I leave the site, and then come back some time later, I am already logged into the frontend.  However, if I try to do anything in the forum (ie post a new thread, find admin area etc), then I am redirected to http://www.mysite.com/forum/  and asked to login again with my password.  This means that I get thrown out of Joomla!

So from then on, I am no longer seeing the forum through the Joomla Wrapper, instead, I am looking direct at the forum.

Now if I implement the code above, I get another problem.  As above, I am logged into Joomla, but not SMF.  So SMF will ask me to login again, but the code above will redirect me back to Joomla again, and I still will not be logged in.  The only way to login to the forum therefore is to logout of Joomla, and then log back in again.  This is very confusing for users.

Therefore, is there a way of implementing the code above ONLY if a member logs into the forum?


Hope that makes sense coz it does to me :>
Logged
-Wolverine
Moderator
Joomla Guru
*****

Karma: +376/-34
Offline Offline

Posts: 3393


Lead Developer


View Profile WWW
Re: How to avoid visit the forum by www.domain.com/smf ?
« Reply #4 on: February 04, 2007, 12:26:35 PM »

the admin section problem is covered in the JSMF user guide.
Logged

Need help?  Check Here First!
Get the JSMF User Guide
SEARCH this forum.
Taj Shah
Joomla Newbie
*

Karma: +0/-0
Offline Offline

Posts: 3


View Profile
Re: How to avoid visit the forum by www.domain.com/smf ?
« Reply #5 on: February 27, 2007, 03:21:15 AM »

the admin section problem is covered in the JSMF user guide.
I couldn't find anything in the manual, but I used the code referred to above from SimpleBoards and put it in the very top of my index.php file for the forum and it does the trick.

Oddly enough, if Joomla throws you out to SMF to enter your password, it does not re-direct until after you enter your password, so does the job nicely.
« Last Edit: February 27, 2007, 07:06:51 AM by Taj Shah » Logged
baijianpeng
Joomla Newbie
*

Karma: +0/-38
Offline Offline

Posts: 46


JoomlaGate.com


View Profile
Re: How to avoid visit the forum by www.domain.com/smf ?
« Reply #6 on: July 30, 2008, 08:51:23 PM »

you can also put this code in your SMF index.php:

Code:
// Redirect users who try to access /forum directly
if (strpos($_SERVER['QUERY_STRING'], 'dlattach') === false && strpos($_SERVER['QUERY_STRING'], 'verificationcode') === false)
{
        if(!defined('_VALID_MOS')){ header("Location: /index.php?option=com_smf&Itemid=yourItemidNum&".$_SERVER['QUERY_STRING']);}}
}

this was written by Kindred at simplemachines.org
http://www.simplemachines.org/community/index.php?topic=81152.msg541379#msg541379

Recently I upgraded to SMF 1.1.5 (by large package overwrite), and found the JoomlaHacks bridge can still work.

But when I insert those code into the index.php, then I got blank page when visiting the forum homepage.

Maybe I inserted in a wrong place?

Could you please help me again?
Logged

JoomlaGate - Open the gate to the World of Joomla!

http://www.joomlagate.com
Superdaantje
Joomla Guru
*****

Karma: +266/-23
Offline Offline

Posts: 370


Aka Livebox


View Profile WWW
Re: How to avoid visit the forum by www.domain.com/smf ?
« Reply #7 on: July 31, 2008, 02:48:53 PM »


Could you please help me again?

Do you mean Wolverine... Tongue
I thought you all ready using an other Bridge. You where complaining so much about the JSMF Bridge on several forums.  Huh

Maybe next time…


Logged

My Projects
Joomlabridge.org JSMF 2.0.2.1 Bridge Support and Downloads
Dutchjoomla.org Dutch Joomla Community (more then 60.000 members)
D.Wagner Webservices
Pages: [1] Go Up Print 
« previous next »
Jump to:  



Login with username, password and session length

Powered by MySQL Powered by PHP Joomla Forum | Powered by SMF 1.1 RC1.
© 2001-2005, Lewis Media. All Rights Reserved.
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!

Joomla Hacks is a Joomla Components, Joomla Modules, Joomla Templates, & Joomla Mambots resource portal. None of the text or images in this public website may be copied without the expressed written consent of the authors. Copyright 2005 by JoomlaHacks.com. Powered by Joomla. All rights reserved.
Terms of Use
Joomla Hacks



Joomla Hacks
German Lang French Lang Italian Lang Spanish Lang Japanese Lang Chinese Lang
MamboBuzz.com
Search Contact About Advertise Blogs Topsites Submit News Register Login