WordPress + laravel

I am working on a big wordpress project for my university, this is my first time working with wordpress and i’ve run into some issues. Essentially i have two folders in my var/www called portal and studyconnect. The ‘portal’ contains the wordpress install and studyconnect contains the laravel app that works as the API I need to consume for the angular portions of a wordpress page. I had issues accessing the laravel install because wordpress was trying to route every link. To get around that issue i created a sym link in my wordpress folder. So the folder ‘portal’ contains a sym link studies->../studyconnect/public. My virtual host config contains the following:

DocumentRoot /var/www/portal
    <Directory />
            Options FollowSymLinks
            AllowOverride none
    </Directory>
    <Directory /var/www/portal/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all

    RewriteEngine on
    RewriteRule ^(server-info|server-status) - [L]
    RewriteCond %{HTTP_HOST} ^(www.)?studyconnect.ctsi.ufl.edu [NC]
    RewriteRule (.*) http://test.ctsi.ufl.edu/studyconnect/$1 [L]
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
    </Directory>

The problem i am having right now is that the laravel portion is working and i can access it. The index page of the wordpress site opens but whenever i try to open any page/follow the link on the page the site gets stuck in a redirect loop.

Read More

The .htaccess from the wordpress site is as follows:

begin wordpress

 <IfModule mod_rewrite.c>
       RewriteEngine On
       RewriteBase /
       RewriteRule ^index.php$ - [L]
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteRule . /index.php [L]
 </IfModule>

end wordpress

Any help to point me in the right direction will be appreciated.

It is the latest version of wordpress. The server is running on debian wheezy. PHP version is 5.3.3. I have only modified the functions.php inside wordpress to include the angular script and app.js

wp_register_script(‘angular-core’, “https://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.js“);
wp_enqueue_script(‘angular-core’);
wp_register_script(‘angular-app’, get_bloginfo(‘template_url’).’/app.js’, array(‘angular-core’), null, false);
wp_enqueue_script(‘angular-app’);
/

Related posts

Leave a Reply

1 comment

  1. You might need to add anoter RewriteCondition to the .htaccess saying basically if it does not equal /studies/ route through index.php so it will follow the symlink

    <IfModule mod_rewrite.c>
           RewriteEngine On
           RewriteBase /
           RewriteRule ^index.php$ - [L]
           RewriteCond %{REQUEST_FILENAME} !-f
           RewriteCond %{REQUEST_FILENAME} !-d
           RewriteCond %{REQUEST_URI} !^/study/
           RewriteRule . /index.php [L]
     </IfModule>