Since it's a very common source of issue, here are few things everyone (using phpBB3 with or without mods) should notice about phpBB Server and Cookie settings.
As you should know, you have a Server configuration category in the main phpBB ACP tab. The two menu we are talking about are Cookie settings and Server settings. In what follows, we will use the example domain example.com, which you of course will have to replace with your actual domain. Same with the eventual sub directory phpBB/, remember it's just an example.
- Let's start with Server settings :
The part we'll be working on is the Server URL settings. As you can see, by default, phpBB will have the Force server URL settings set to no. This mean that the below settings are basically overridden by some script that will try to find out about the values to use for them automatically.
This usually works, but not always, as some server set up will trick the script trying to properly set these values automatically.
So, in the general case, it's always better to make sure that the values entered are correct, even if the automatic way works.
And, it's just mandatory with our mods, since we tend to prefer a frontal issue (my site links to localhost when I turn on mod rewrite) than to have potentially hard to find issue related to how phpBB may, or may not, find out about the proper values to use.
Making sure that you always set these value properly is as well a way to remind to our user that this is just a crucial setting, and besides, some bug (few but still) where reported for phpBB only (no mods) when the automatic way works, but the values in the config are not correct. This occurs for most when you first installed you forum on a local / test server, and then move it to your real domain.
The automatic server set up may make this invisible, but in such case, your phpBB config will still be set for the local / test server (location of the scritp and domain). And it's just not wise to keep wrong data, even unused, in your online phpBB config.
To conclude, everyone should always make sure that the server settings are set properly, even if it looks like working. And further more, it is just mandatory with our SEO URL mods!
So basically, phpBB can be installed in a domain or a sub domain :- Code: Select all
www.example.com
sub.example.com
example.com
and it can be installed in the domain's (or sub domain's) root, or within a sub-directory (phpBB/).
Here are the proper settings to use :- Server protocol: should be set to http:// (default) unless you use cookie secure (https protocol)
- Domain name: should be set to the domain or sub domain you actually want to use, either www.example.com, sub.example.com or example.com
- Server port: should almost always be set to 80, if you wonder about it, just use 80, the setting should only have meaning for those, and they are very few, who actually need to change it.
- Script Path: Should be set as follow :
If phpBB is installed within a sub directory of the above configured domain (or sub domain), meaning that you can reach it using domain/phpBB/ then use /phpBB
If phpBB is installed in the domain's (or sub domain's) root, meaning that you can reach it using domain/ as url, then use /
The common mistake here, is when phpBB is installed in forum.example.com/, but is as well reachable through example.com/forum/ (the kind of cases where the automatic set up may fail as well). In such case, the actual phpBB domain is forum.example.com and the script path is just / since phpBB is installed in the (sub) domain's root!
- Now the Cookie settings :
Cookie setting are not set automatically, so they should just always be properly set.- Cookie domain: In all cases, you should use .example.com with the dot (".")!
Doing this will make sure that you, and your user will not loose cookie based sessions (usually, the majority of sessions) when going from a sub domain to another one. This include going from example.com to www.example.com since www is a genuine sub domain of example.com, and of course, going from www.example.com to sub.example.com
So it's almost always mandatory, since you should almost always be able to at first use both example.com and www.example.com - Cookie name: Here you can use pretty much what you want using A to Z (no accent), lower and upper cases, digits (0 to 9) and underscores ("_"), but do not use hyphens ("-") as it could just break sessions with some browsers. So make it simple and unique enough. The default value is usually good to keep.
- Cookie path: In almost all case, / is the value to use here. It should work in all cases and should not cause trouble, so just use it unless you really need to use another path (in such case, you should know what you are doing).
- Cookie secure: It's up to you to decide, but in far most case, running a phpBB under the https protocol has not always much meaning. And it requires a valid SSL cert installed on the server.
- Cookie domain: In all cases, you should use .example.com with the dot (".")!
You can use this thread to discuss this matter.
++

English |
French

