I'm using PunBB from 14 years and I'm very happy with it. Now my hosting company Webfaction terminates work and I'm moving on another hosting. However, I cannot set the forum properly.

The problem is that when I'm trying to log in, it redirects to https://hostanme/login but the actual rout must be https://hostname/forum/login. It is PunBB 1.4.5

I suppose that the problem comes from the way I set virtual hosts.

Nginx proxy:

server {
    listen 443 ssl;
    server_name example.com;

    index index.html;
    root /my/web/dir;

    location /forum/ {
        rewrite  ^/forum/(.*) /$1 break;

Apache virtual host:

    ServerName example.com
    DocumentRoot /my/web/dir/forum

    <Directory /my/web/dir/forum>
            Options FollowSymLinks
            AllowOverride All
            Require all granted


<IfModule mod_rewrite.c>
  Options -MultiViews

  RewriteEngine On

  RewriteBase /

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . rewrite.php [L]


$base_url = 'https://example.com/forum';

This was the only way I succeed at least to show the forum. However, the login and probably other stuff doesn't work.

When I try to log in, the "Confirm action" appears with wrong links in the form.

<form method="post" action="https://example.com/login/">
    <div class="hidden">
        <input type="hidden" name="prev_url" value="https://example.com/login/">
        <input type="hidden" name="redirect_url" value="https://example.com/">

The correct links are _https://example.com/forum/login

Please help me to solve the problem or to make virtual hosting in a better way.

On the old hosting, the .htaccess has `RewriteBase /forum`, however with it, the forum doesn't work here.

If I remove `rewrite  ^/forum/(.*) /$1 break;`, it gives "Request exceeded the limit of 10 internal redirects due to probable configuration error."


(5 replies, posted in PunBB 1.4 bug reports)

The problem still persists and an answer is not available. The linked website is unreachable.

The error appears also here:

Deprecated: Function create_function() is deprecated in .../admin/index.php on line 73

Vistman, please post your answer here instead of a link. It would be better for the visitors of this forum and also will make your answer useful in case of the linked page is not available.

You are awesome!

You saved my day.

Miroslav Popov

Hello Lion,

Did you find a solution?

I have the same problem.


I installed a SSL certificate on my forum and want to access it under: _https://forexsb.com/forum/

I can read the forum, however when I want to post or to login, it gives an error as follows:


After clicking to confirm, it gives error trying to access the site on port 80:


My config.php is:

$p_connect = false;

$base_url = 'https://forexsb.com/forum'; 

$cookie_name = 'forum_cookie';
$cookie_domain = '.forexsb.com';
$cookie_path = '/';
$cookie_secure = 0;
define('FORUM', 1);
//define('FORUM_DEBUG', 1);

Any ideas how to fix it?


(153 replies, posted in Supported extensions)

PanBB.Ru you are very helpful  !!! how much time took you to post these links? And how mach time would take you to fix this official extension?  pun_pm is an official extension right?

I'm also developing and providing free software from 10 years. The fact PunBB is free and open source is not an excuse for unfinished work. PunBB 1.4.4 is online from 2 months. Why you don't take a look at the official extensions?

I would be more than happy if it was a commercial support for this software and there was a service for fixing such issues.

Maintaining a free and open source product is a responsibility to provide not worse but better quality than the commercial ones.


(153 replies, posted in Supported extensions)

After updating to punbb v1.4.4 I receive an error message with  Private Messaging 2.4.2 extension:

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in ../extensions/pun_pm/functions.php on line 627
    $str1 = preg_replace('#^Re\[(\d{1,10})\]: #eu', '\'Re[\'.(\\1 + 1).\']: \'', $str);

Any idea how to fix it?


(75 replies, posted in News)

Thank you,
it works fine.


(75 replies, posted in News)

I'm facing Fancy Video Tag v 0.4.10

When I enable it, I receive the following error:

Warning: preg_replace_callback(): Modifier /e cannot be used with replacement callback in /home/forexsb/webapps/forexsb_forum/include/parser.php on line 811

It looks like it's original author is not supporting it anymore.

So my question is if this extension can be fixed or we have to revert back to PunBB v 1.4.2.

We are 2016 already. How this forum software has no a video integration plugin !?!?!
Shame. Once back in the time PunBB was the best forum software.


(75 replies, posted in News)

Visman wrote:
string(30) "`\[video\]([^\[]+)\[/video\]`e"

The extension containing the video bb-code is guilty.

Can we fix this plugin in order to work in Punbb 1.4.4 ?
I'm using it in my forum from long time and I have many videos posted.


(39 replies, posted in News)

However, I encountered a bug with the responsive menu. On smarphones, tablets and PCs with smaller screen everything works fine, but on my 23-inch monitor I get something like this:

Press Ctrl+F5 to reload the new CSS files.

Visman wrote:

$base_url in config.php?


I forgot that I set it for testing the new hosting before moving.

Thank you.


I changed my hosting company.

After transferring the forum, it works fine, but the internal links point to the server of the hosting company.

you can check it here: forexsb.com/forum


Any ideas?


(7 replies, posted in Discussions)

For v1.4.2 the line you have to correct is 662 in file include/parser.php.

old line

        return '<a href="'.$full_url.'">'.$link.'</a>';

new line

        return '<a href="'.$full_url.'" rel="nofollow">'.$link.'</a>';


(2 replies, posted in Feature requests)

These addons can help:

Antispam System 1.3.4 Created by PunBB Development Team
Adds CAPTCHA to registration, login and guest posting forms. Puts restrictions on adding user signatures and website links.


Fancy Stop SPAM 1.3.53 Created by dimka.linux@gmail.com
Antispam system for PunBB 1.4

Extension will be nice. It will allow setting of TimeSpan interval, option for excluding closed topics and optionally filtering out selected forums.
For example my forum has a General category, which I'm not interested to read frequently. I need to see only my specified categories in New Posts and Active Discussions.

In details I want New Posts to show posts only from Category #3.

First I added  to the request 'show_new' at line 450

'WHERE'        => 'f.cat_id=3 AND (fp.read_forum IS NULL OR fp.read_forum=1) AND t.last_post>'.$forum_user['last_visit'].' AND t.moved_to IS NULL',

It works for "New Posts" link that is below the forum nav menu bar but it breaks the New posts link that appear next to the forum title for the forums in other categories.

So my second attempt is to change line 454 to:

            if ($value == -1)
                $query['WHERE'] .= ' AND f.cat_id=3';
                $query['WHERE'] .= ' AND f.id='.$value;

Actually I'm not sure what exactly $value is when searching new posts. I only suppose that  $value == -1 when using the top link and $value is the number of the forum when we use the forum link.

Is this correct?

Filtering out closed topics



t.last_post>'.(time() - 946080000).' AND 

Doesn't work.

I googled further and changed it to

t.last_post>'.strtotime("-1 year", time()).' AND

It works fine.

Remains the problem with Closed status.

I want to change "Unanswered topics" command behaviour.

I want it to show topics that are not closed and that are not older than 1 year.

I found out that have to change line 694 of .\include\search_functions.php

'WHERE' => '(fp.read_forum IS NULL OR fp.read_forum=1) AND t.num_replies=0 AND t.moved_to IS NULL',

I have to add:

t.last_post>'.(time() - 946080000).' AND 

where 946080000 is seconds for one year. 60*60*24*30*365

Is this correct?


How to filter out Closed topics?


(4 replies, posted in Feature requests)

Such functionality was requested several times from my users.


(2 replies, posted in Discussions)

Happy New Year,

Wish you good health, love and success.

All the best to forum developers and contributors!
Lets continue maintaining and improving our favorite forum software PunBB!

Download link is broken.


(2 replies, posted in Discussions)

Thank you. Excellent answer.


(2 replies, posted in Discussions)

Do you have any examples of how to add a search box in forum header?
In what format to refer to search.php in order to show search results?

Thank you


Add navigation strip in forum header area:


Add box for adding links in forum settings page: