Search code examples
phpwordpressapachealiasphpbb3

How can I run Wordpress and phpBB in the same Apache server?


I've been testing my new web site in a MAMP environment.

The folder /wordpress/ contains a Wordpress web site.

The folder /bb/ contains a phpBB3 forum.

When I complete them, I'll have to move those sites to my server machine running with Mac OS X Server 10.9. It is basically an Apache server.

I thought that with [Apache Alias][1] functionality I could trick the URLs. For example, a request for www.xxx.com will be taken to www.xxx.com/wordpress/. This way visitors don't have to bother typing wordpress.

On the other hand, a request for the forum should be treated in a separate way. For instance, www.xxx.com/bb/ should be treated as http://www.mbs.med.kyoto-u.ac.jp/bb/ itself.

To achieve the above, I run preliminary tests on Apatche Alias. But it seems that my strategy may not work. I thought the following would work.

Alias / /wordpress
Alias /bb /bb 

Currently, only the phpBB3 forum has been transferred to the server. So I made a dummy wordpress folder containing an html file to test the behaviour of Alias. Alias / /wordpress can show the html file in the dummy /wordpress/ folder in a browser.

However, Alias /bb /bb didn't work well. www.xxx.com/bb showed an index page for the content of bb folder (i.e. list of file names), rather than showing the phpBB3 forum running. The results suggest that the Alias can be useful for simple html pages, but php-driven web pages may have serious problems.

Is there a way to achieve what I planned? Or is it just not possible? Could it be phpBB3 or Wordpress configurations related to URL? Or do I have to redesign the whole thing with WP-united, WP phpBB Bridge or something (for our purpose, the Wordpress site and the phpBB3 forum don't need to be integrated)? Your expert advices will be appreciated.


Solution

  • I would go for a .htaccess file in your root folder. Then something like this should work (didn't test it)

    RewriteEngine on
    RewriteCond %{REQUEST_URI} !^/bb/
    RewriteRule (.*) /wordpress/$1 [R=301,L]
    

    (Source: Redirect site with .htaccess but exclude one folder)