子目录博客文章wordpress未在laravel中显示

子目录博客文章wordpress未在laravel中显示,wordpress,laravel,Wordpress,Laravel,我正在使用wordpress作为我在laravel网站上的博客。wordpress博客被放置在子目录中,因此wordpress的域是mydomain.com/blog 我已经在我的本地主机上测试了它,它工作得非常好。但当我将它部署到服务器上时,该站点可以显示我博客的主页。但它无法显示博客的页面,例如:domain.com/blog/contact(未找到404页) 我已经完成了几个步骤,比如定义WP_HOME/WP_SITEURL,但它仍然无法显示我的博客文章 这是我的wordpress.hta

我正在使用wordpress作为我在laravel网站上的博客。wordpress博客被放置在子目录中,因此wordpress的域是mydomain.com/blog

我已经在我的本地主机上测试了它,它工作得非常好。但当我将它部署到服务器上时,该站点可以显示我博客的主页。但它无法显示博客的页面,例如:domain.com/blog/contact(未找到404页)

我已经完成了几个步骤,比如定义WP_HOME/WP_SITEURL,但它仍然无法显示我的博客文章

这是我的wordpress.htaccess

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

RewriteEngine On
 RewriteCond %{REQUEST_URI} !^/blog/ # <=== NEW LINE!!!!
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

重新启动发动机
重写库/博客/
重写规则^index\.php$-[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/blog/index.php[L]
下面是我的laravel网站的.htaccess

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

RewriteEngine On
 RewriteCond %{REQUEST_URI} !^/blog/ # <=== NEW LINE!!!!
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

选项-多视图
重新启动发动机

重写cond%{REQUEST_URI}^/blog/#你能展示一下你的Laravel
.htaccess
和Wordpress
.htaccess
文件吗?我已经添加了我问题中的文件,你看到有什么问题吗?你所有的
.htaccess
文件似乎都没问题。你的wordpress目录怎么样?它在laravel_project/public/blog中,对吗?是的,这就是为什么它在我的本地主机中运行良好的原因。但是当我使用
nginx
apache
在您的服务器上部署post时,它在显示post时出错了?因为
.htaccess
文件配置只在
apache