Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/vba/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在apache服务器的laravel中安装wordpress_Wordpress_Apache_Laravel_.htaccess - Fatal编程技术网

在apache服务器的laravel中安装wordpress

在apache服务器的laravel中安装wordpress,wordpress,apache,laravel,.htaccess,Wordpress,Apache,Laravel,.htaccess,我已经把我的wordpress放在了laravel的public/blog文件夹中。在我的情况下,把这个RewriteCond$1^(blog)到.htaccess文件中,我可以通过www.mysite.com/blog安装和访问wordpress。唯一的问题是当我将永久链接从这个/blog/?p=123更改为这个/blog/%postname%/。这给了我一个错误 RouteCollection.php第161行中的NotFoundHttpException 那么,我怎样才能拥有像www.my

我已经把我的wordpress放在了laravel的public/blog文件夹中。在我的情况下,把这个
RewriteCond$1^(blog)
到.htaccess文件中,我可以通过
www.mysite.com/blog
安装和访问wordpress。唯一的问题是当我将永久链接从这个
/blog/?p=123
更改为这个
/blog/%postname%/
。这给了我一个错误

RouteCollection.php第161行中的NotFoundHttpException


那么,我怎样才能拥有像
www.mysite.com/blog/my post

只需设置
RewriteCond$1^(博客)
还不够

将该行替换为
RewriteCond%{REQUEST\u URI}^/blog/
,因此它将忽略所有以/blog/开头的URI

然后别忘了更改WP.htaccess:

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

RewriteRule . /blog/index.php [L] #change here
</IfModule>

重新启动发动机
RewriteBase/blog/#在此处更改
重写规则^index\.php$-[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/blog/index.php[L]#在此处更改

最好使用子域。但我不想使用子域