laravel 和 wordpress 在同一个域上(laravel 在子文件夹中)

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

我有 wordpress 和 laravel 应用程序,它们应该使用 AJAX 进行通信 - 所以它们必须在同一域中。

wordpress 站点应该在主域上 - MYdomain.com。 我的 laravel 应用程序将在 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(我的域。com/panel)

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

我收到内部服务器错误 来自 apache2 文件夹的日志是:

[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

如何解决?

谢谢!!

你的主 .htaccess 是这样的。

# 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

在面板文件夹中将您的规则更改为这样。

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