MyBB Community Forums

Full Version: Having a /forums/ at back of url
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Okay so I have got 2 websites, one is my homepage website which introduces it purpose and all that stuff and the other which is my forum website powered by MyBB of course. Okay so I want my homepage website to have a /forums/ at the back of its url for example: www.yourwebsite.com/forums/. So that when the users click on the Forums tab in the navigation bar of my main website(I will call it homepage for the rest of the post), it will send them from my homepage website to the forum website. So there is 2 domains for both homepage and forum websites. Any idea how to do so? And note that the domains are subdomains. I hope you guys can understand my needs.. err question/problem. If you don't understand, just comment that you don't understand and I will try to err.. simplify my question/problem to you Smile And finally, if this is the wrong section to post just tell me and I will note it down in future problems/questions similar to this. Thanks guys and peace out!
Richard.
Put all the mybb files in a subdirectory called forums instead of having two subdomains.
So I transfer the files inside the root directory of my forum website into my homepage's root directory inside a folder named forums which is inside the directory? But it is that so, then won't everything be lost?
When you do the move you have to change the acp settings to point at the forums directory instead of the subdomain.

You will also have to export your db and import to a new db on the homepage domain.
[attachment=34010]db??? what is db? sorry if I don't understand some files MyBB has and when I move, what do I have to change in my ACP settings? A shot attached for you to aid me. 
db = database. You need to learn how to export and import your database as you need this for backups and restore.

If you are unsure it might be best not to bother, and just live without having forums on your url. I am sorry, but I have a lot to do right now and I cannot give you extensive support on how to use phpmyadmin etc to manage your databases.
Oh ok, thanks for your help. So I created a backup database for the forum website, 2 backup database, one in the backup directory and the other a download backup. What should I do next?
Richard,

It's important to understand that the files aren't magic, and the code works the exact same no matter where you put the files. MyBB consists of those files, and a database, which is totally independent of what directory your forum is in, since MySQL databases are available server-wide. This is one of those things that a lot of people can't always wrap their heads around.

Move the files into a directory called forums, then open inc/settings.php and search for cookiepath, change it to /forums. Cookiedomain is just fine. Also search for bburl, and add /forums on the end, WITHOUT a trailing slash.

Then go to your forums at yourdomain.com/forums/admin (or whatever you've named your ACP directory). Log in and go to the Configuration category. Search for the setting "Board URL" with the search box, and change it to match what we put in inc/settings.php. Do the same for Cookie Path.

Why do we do this? Well, your database config will still work if you move the files, so we don't have to worry about that. And the code, as long as it's still in its same relative structure, will work just fine. So it's all about the settings. If you don't update the Board URL, then the links generated in templates won't work quite right, so we fix that. If you don't update the cookie path, then MyBB won't be able to set/read the cookie when you log in, so you'll never stay logged in. But if we fix the cookie path, then it will work.

We do this in inc/settings.php first because settings.php is a cache for the settings that are stored in your forum's database. We must change it here first, otherwise you won't be able to log into your ACP and stay logged in long enough to change the setting in the database for the permanent change.

Then we do it in the database, by changing the settings in the ACP. This makes our changes permanent.
Ah wow... a very detailed explanation and it helps me understand it a lot! Thank you Josh for the detailed explanation! Thank you so much!

Sir there was an error when I accessed the ACP,
MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1130 - Host '10.1.1.39' is not allowed to connect to this MySQL server
Query:
[READ] Unable to connect to MySQL server
^ config.php file in inc folder of MyBB system files consists of the database details.
ensure that you have correct values for database name,database host, user & password.
also you need to ensure that database user has all the privileges to use the database.

it might be confusing in the beginning. if you need direct help then you may PM me
web host panel login & the data base login. you can change your credentials later.