phpBB Server and Cookie settings

Discussions about the phpBB3 Forum. How to get the best from this powerful script.
Note that there is no official support for phpBB3 here, a place to share more than to ask for.

Moderator: Moderators

phpBB Server and Cookie settings

Postby dcz » Sun Apr 26, 2009 9:16 am

Hello,

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 :
      :arrow: 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
      :arrow: 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.

You can use this thread to discuss this matter.

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21291
Joined: Fri Apr 28, 2006 9:03 pm

Advertisement

Re: phpBB Server and Cookie settings

Postby anandharaj » Mon Jul 06, 2009 5:52 am

Hi,

Thanks for the info, its a very good explanation. Initially i did face issue on the "server domain". But i have a question, I have 2 set of forum "site" (1 for testing with SEO) which point to same DB. Changing the value of "server domain" in "test site" does not effect the "real forum". So where this values is stored? not in DB?
anandharaj
 
Posts: 26
Joined: Sat Jul 04, 2009 2:42 pm

Re: phpBB Server and Cookie settings

Postby Typo » Mon Jul 06, 2009 7:47 am

It is stored in the db.

Did you clear the cache after applying the change? if not, just delete every folder in the cache dir except for the .htaccess.

Let us know if that helps.

Typo
User avatar
Typo
phpBB SEO Team
phpBB SEO Team
 
Posts: 346
Joined: Sun Jan 18, 2009 11:33 am

Re: phpBB Server and Cookie settings

Postby anandharaj » Mon Jul 06, 2009 8:02 am

Yes, i did clear the cache (ACP -> General -> purge the cache) and the cookies, but i still have two different value for both forum. Really wired, perhaps its keep the value somewhere else?
anandharaj
 
Posts: 26
Joined: Sat Jul 04, 2009 2:42 pm

Re: phpBB Server and Cookie settings

Postby donaldjeo » Sat Apr 17, 2010 10:58 am

Wao.. thanks i have already phpBB forum but always i failed to configure with server. Your tutorial is great, Let start the setting if i face any problem i ill upload the problem and hope you or any body can help me soon... 8)
Have a nice day;
[mod]Link Removed[/mod]
Last edited by dcz on Sat May 01, 2010 12:51 pm, edited 1 time in total.
Reason: As per rule5a : Linking offsite is allowed if links are being offered in a "relevant discussion context".
donaldjeo
 
Posts: 2
Joined: Sat Apr 17, 2010 10:49 am

Re: phpBB Server and Cookie settings

Postby Stephen26 » Mon Jun 21, 2010 12:57 pm

Very good explanation! Unluckily the correct settings (Cookie domain: .secondleveldomain.tld, Cookie name: slightly different then before so everybody uses the new settings when visiting next time, Cookie path: /) don't work on my board. Does it make sense to try "localhost" or "www.secondleveldomain.tld" in those cases? Thanks
I install and configure phpBB-SEO (and other mods) for a fair price and very fast. If you are interested simply send me a private message.
Stephen26
phpBB SEO Team
phpBB SEO Team
 
Posts: 407
Joined: Mon May 03, 2010 7:06 am

Re: phpBB Server and Cookie settings

Postby thezodiac » Mon Sep 20, 2010 1:15 pm

Thanks for the explanation it cleared some misunderstandings for me about the cookie.
thezodiac
 
Posts: 34
Joined: Mon Sep 20, 2010 10:43 am

Re: phpBB Server and Cookie settings

Postby koimaster » Thu Mar 03, 2011 9:16 pm

does this inculed i,e
my site :http://www.ukkrazykoi.com
sub domain :http://www.ukkrazykoi.com/koiforum-f7
koimaster
 
Posts: 20
Joined: Tue Feb 01, 2011 6:32 pm
Location: devon uk

Re: phpBB Server and Cookie settings

Postby SeO » Fri Mar 04, 2011 8:04 am

what do you mean ?
SeO
Admin
Admin
 
Posts: 6334
Joined: Wed Mar 15, 2006 9:41 pm

Re: phpBB Server and Cookie settings

Postby koimaster » Fri Mar 04, 2011 8:19 pm

i have google rating my -http://www.ukkrazykoi/koiforum-f7
higher than -http://www.ukkrazykoi.com . this being the main domain which i want everyone to see
koimaster
 
Posts: 20
Joined: Tue Feb 01, 2011 6:32 pm
Location: devon uk

Re: phpBB Server and Cookie settings

Postby adipa » Fri Apr 22, 2011 5:06 pm

Very good explanation... txs :)
adipa
 
Posts: 21
Joined: Wed Mar 30, 2011 5:17 pm

Re: phpBB Server and Cookie settings

Postby rohansakhale » Wed Aug 17, 2011 3:14 am

Not able to get the script path in .htaccess,
I have tried all the multiple combinations.

Please help,
I have placed phpbb in a forum call /forum and so my entire site path becomes xyz.com/forum
But in .htaccess it is showing root as xyz.com and not xyz.com/forum

Thank You
rohansakhale
 
Posts: 13
Joined: Sat Mar 13, 2010 8:35 am

Re: phpBB Server and Cookie settings

Postby dcz » Wed Aug 17, 2011 7:14 am

Two option, either you are generating an .htaccess meant to be used in /forum and thus only mentions it once in the rewritebase, or you did edit the db directly and did not clear phpBB's cache. Of course, these two options stands if you did some how use /forum as your script path.
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21291
Joined: Fri Apr 28, 2006 9:03 pm

Re: phpBB Server and Cookie settings

Postby rohansakhale » Wed Aug 17, 2011 10:02 am

I didn't add anything directly to the db, i am using /forum as the script path in Server Settings.

How can i solve this issue ???
rohansakhale
 
Posts: 13
Joined: Sat Mar 13, 2010 8:35 am

Re: phpBB Server and Cookie settings

Postby dcz » Thu Aug 18, 2011 7:09 am

Do you see the forum/ script path somewhere in the .htaccess (you should), if not generate a new one and make sure you place it exactly where the red message tells you to.
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21291
Joined: Fri Apr 28, 2006 9:03 pm

Next

Return to phpBB Forum

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 9 guests


 
cron