Search code examples
phpzend-frameworkurlphpbb

Zend Framework with phpBB: URL problem


I am using zend framework with Apache sever on Ubuntu. When I try my site on localhost, I use following url

for example:

http://test.dev/authentication/login
http://test.dev/student/profile

Where 'authentication' refers to AuthenticationController and 'login' refers to loginAction. 'student' refers to StudentController and 'profile' refers to profileAction.

Question: Now I want to use phpBB forum with my site. I had to use the following URL to start phpBB forum with my website.

http://localhost/test/forum/

Where 'test' is my main project(website) directory. I want to use following URL for phpBB forum.

http://test.dev/forum/

How to configure my project to open phpBB forum using above URL? Should I create a controller?

Thanks


Solution

  • After some time I have found my answer. I just placed my 'forum' folder in 'public' folder and it is working for me without changing my .htaccess file.

    Here is my settings:

    My directory structure is now like this:

    /var/www/test/public/index.php
    /var/www/test/public/.htaccess
    /var/www/test/public/forum
    

    My httpd.conf entry is like this:

    <VirtualHost 127.0.0.1>
        ServerName test.dev
        DocumentRoot 'C:\wamp\www\test\public'
    </VirtualHost>
    

    My .htaccess file is like this(it controls both folder and controller/action URLs):

    SetEnv APPLICATION_ENV development
    
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} -s [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]
    RewriteRule ^.*$ index.php [NC,L]
    

    Last line in above .htaccess file allow me to use my URL without index.php in URL.

    After above setting I am able to use following URLs correctly:

    http://test.dev/authentication/login
    http://test.dev/student/profile
    http://test.dev/forum/
    

    In above URLs 'authentication' and 'student' are controllers. 'login' and 'profile' are actions and forum is a directory

    Comments are welcome. Thanks