MyBB Community Forums

Full Version: How to view portal on domain root while MyBB is installed on a subdirectory
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Hi,
this is a very simple tutorial. Smile

Assuming that you have installed MyBB in a subdirectory...

http://example.net/forum/

... and you want to display the portal of MyBB in your domain root:

http://example.net/

Just create a .htaccess file and put it in your domain root...

http://example.net/.htaccess

... with the following content:

<IfModule mod_rewrite.c>
	RewriteEngine on
	RewriteRule ^$ forum/portal.php [L,QSA]
</IfModule>

You don't need to put any other file of MyBB in your domain root. The .htacces is everything you need!

Whenever someone request example.net/ the content of example.net/forum/portal.php will be shown! This is not a simple redirect because there is still example.net/ in the browser address bar!

PS: Of course you don't need to create rewrite to portal.php - you can also do it with index.php or whatever you want.

Hint: This works with Apache web server only!
Thanks for this. I have been looking for this for a few days Smile
Yes, good tutorial. Thanks Smile
Good tutorial, but there is a problem with login on portal page.
(2010-02-03, 04:58 PM)ecanikajo Wrote: [ -> ][...] but there is a problem with login on portal page.

Of course you have to set your cookie path to:
/
Thank you I will use this.
Waow...
So simply, yet so good ^^.

Not working very well....
All links then point to example.net/
For example hitting search will bring in example.net/misc.php?action=help even when my board address uses the /forum ( example.net/forum ).

Example.net does not represent my own domain, i'm not that stupid >,<.
But it's just too good to be true, this ain't as easy as it looks.
start of the page:
<?php
$olddirectory = getcwd();
define("IN_MYBB", 1);
chdir('/www/htdocs/XXX/forum'); // path to MyBB
require ("/www/htdocs/XXX/forum/global.php");
include_once("/www/htdocs/XXX/forum/portal.php");
chdir ($olddirectory);
?>
that should be callable from any position on your domain.

what it does:
- remember where it was called from
- go to the forum folder
- call global.php and portal.php there
- return to the original location
Thanks much! However, when I login via the header, it redirects me to member.php when I need to go to forum/member.php.

I am using ProPortal.
Fixed by symlinking forum/member.php to member.php
Pages: 1 2 3