I'm trying to add XenForo to my Phalcon application. The project is structured like this:
www/
phalcon/
app/
controllers/
AccountController.php
views/
account
login.phtml
public/
forums/ <-- XenForo installation
.htaccess
index.php
.htaccess
The file at www/phalcon/.htaccess
looks like this:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ public/ [L]
RewriteRule (.*) public/$1 [L]
</IfModule>
And the file at www/phalcon/public/.htaccess
looks like this:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L]
</IfModule>
I added a view at www/phalcon/app/views/account/login
with a form that posts to the XenForo login script, which is at http://localhost/phalcon/forums/login
:
<?php echo $this->tag->form('forums/login'); ?>
<p>
<label for="name-email">Name or email:</label>
<?php echo $this->tag->textField('login'); ?>
</p>
<p>
<label for="password">Password</label>
<?php echo $this->tag->passwordField('password'); ?>
</p>
<p>
<?php echo $this->tag->submitButton('Login'); ?>
</p>
<?php echo $this->tag->endForm(); ?>
Posting the form threw an error because I don't have a ForumsController:
PhalconException: ForumsController handler class cannot be loaded
So I modified the file at www/phalcon/public/.htaccess
to this:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(forums)($|/) - [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L]
</IfModule>
This causes Phalcon to ignore any route that starts with forums
. However, now I get a 404 when I post the form:
The requested URL /phalcon/public/forums/login was not found on this server.
I thought XenForo would take over the routing at this point but apparently not. What do I need to do to get Phalcon and XenForo to play nice?