laravel and wordpress on the same domain(laravel in subfolder)

I i have wordpress and laravel app, that should communicate by using AJAX- so they must be on the same domain.

wordpress site should be on the main domain – MYdomain.com.
and my laravel app to be on MYdomain.com/panel .

Read More

wordpress .htaccess :

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

laravel htaccess(mydomain.com/panel)

<IfModule mod_rewrite.c>
RewriteCond ^panel
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>  

i get Internal Server Error
and the log from apache2 folder is:

[Thu Mar 12 15:31:07.596263 2015] [core:alert] [pid 1172] [client     xxx.xxx.xxx.xxx:52628] /var/www/panel/.htaccess: </IfModule> without matching <IfModule> section

how to solve it?

Thanks!!

Related posts

Leave a Reply

1 comment

  1. Your main .htaccess like this.

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_URI} !^/panel [NC]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress
    

    In the panel folder change your rules to be like this.

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