3

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 .

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!!

1 Answer 1

3

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>  
Sign up to request clarification or add additional context in comments.

7 Comments

the problem is not fix, i get the same error in logs,
Edit your question and post the entire contents of both .htaccess files. There is a mistake in there somewhere.
the content of .htaccess files the same as you post ( i took your files and paste them in my files) .
So you don't have anything else in those files but these rules?
Delete both files, recreate them with these rules and clear your cache and see if you still get the error. Use notepad
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.