简体   繁体   English

如何在 laravel 路由中安装 wordpress 网站

[英]How to install a wordpress website inside a laravel route

I'm using laravel.my server is centOS 7 and apache2.我正在使用 laravel。我的服务器是 centOS 7 和 apache2。

This is my laravel routing:这是我的 laravel 路由:

http://example.com/{en}/{county}

But now I want to launch a blog page with url:但现在我想用 url 启动一个博客页面:

http://example.com/{en}/blog

how to add an expected url?如何添加预期的 url?

my blog is a wordpress.我的博客是 wordpress。

I don't want to redirect.我不想重定向。

First thing to do is to separete wordpress and laravel folders, it can cause problem.首先要做的是分离 wordpress 和 laravel 文件夹,这可能会导致问题。

then you need to create a new apache conf那么你需要创建一个新的 apache conf

sudo nano /etc/apache2/conf-available/wordpress.conf须藤纳米/etc/apache2/conf-available/wordpress.conf

in this conf you have to create an alias在这个conf中你必须创建一个别名

Alias /blog /var/www/wordpress/

<Directory "/var/www/wordpress/">
    //here your directory conf
</Directory>

save it, enable it and restart apache保存,启用并重启 apache

sudo a2enconf wordpress.conf须藤a2enconf wordpress.conf

sudo systemctl reload apache2.service sudo systemctl reload apache2.service

now when you type http://example.com/blog you're on wordpress.现在,当您键入http://example.com/blog时,您将进入 wordpress。

For the lang setting, i think it's better to let wordpress manage the language for the blog对于语言设置,我认为最好让 wordpress 管理博客的语言

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM