如何在Laravel的公用文件夹中运行WordPress?

时间:2019-03-18 13:49:00

标签: php wordpress laravel .htaccess

我搜索的内容超出了您的想象,但是找不到有用的东西。因此,我在问这个问题。

我想在Laravel的公共目录中安装WordPress。我有这些配置:

/public/.htaccess

<IfModule mod_rewrite.c>
    RewriteEngine On
    #RewriteCond %{REQUEST_URI} !^/blog/
    #RewriteCond $1 !^(blog)
    # Force http to https
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>

/public/blog/.htaccess

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

/etc/httpd/conf/httpd.conf

DocumentRoot /home/mysite/public_html/public
ProxyPassMatch "^/blog" "unix:/run/php-fpm/www.sock|fcgi://localhost:9000/public/blog"
ProxyPassMatch "^/(.*\.php)$" "unix:/run/php-fpm/www.sock|fcgi://localhost:9000/public/index.php"

问题是mysite.com正常工作,但是mysite.com/blog再次将我重定向到mysite.com,并且mysite.com/blog/index返回此页面,但找不到该样式适用于WordPress。

请帮助我解决此问题。

0 个答案:

没有答案