magento2整合wordpress,把wordpress放在子目录下

3.48K 浏览开发笔记

magento2整合wordpress,把wordpress放在子目录下

比如m2域名为test.mallol.cn

m2网站目录在 /var/www/magento2/下

把wordpress放在 /var/www/magento2/pub/wordpress下

一,先改下m2的nginx.conf.sample文件

找到

location ~* (.php$|.htaccess$|.git) {     deny all; }

改成

location ~* (.htaccess$|.git) {     deny all; }

也就是把php脚本的删掉。如果不删的话 就deny了,导致页面打开404

如果不安装magento2 wp插件的话,还需要添加:

location /wordpress {     rewrite ^(/[^/]+)?(/wp-.*) /wordpress/$2 break;     rewrite ^/wordpress/(.*)$ /wordpress/index.php?q=$1 last; }

二,安装wordpress

访问 test.mallol.cn/wordpress 安装

三,wp后台修改option (可选)

把 siteurl 改成 http://test.mallol.cn/wordpress

把 home 改成 http://test.mallol.cn/blog

四,安装magento2的wordpress插件 (可选)

https://github.com/bentideswell/magento2-wordpress-integration

下载安装

参考

https://fishpig.co.uk/magento/wordpress-integration/installation/

五,m2后台修改wordpress插件设置 (可选)

Path改成wordpress。再保存

注意:还需要去wordpress后台启用FISHPIG主题

最后于 4月前 被admin编辑 ,原因:
0