简体   繁体   English

与laravel网站一起安装WordPress博客

[英]Install WordPress blog along with laravel website

I have a website written in PHP and Laravel 4 framework deployed on Apache web server. 我有一个用PHP和Laravel 4框架编写的网站部署在Apache Web服务器上。 In Laravel, I moved the files from the 'public' folder to the root folder so that users can see the website using the main website address (eg example.com , not example.com/public ). 在Laravel中,我将文件从“ public”文件夹移到了根文件夹,以便用户可以使用主要网站地址(例如example.com ,而不是example.com/public )查看该网站。

Now, I want to deploy a Wordpress blog on the /blog path (eg example.com/blog ) along with the main website. 现在,我想在/ blog路径(例如example.com/blog )上与主网站一起部署Wordpress博客。 I was wondering how can I point that address to the Wordpress blog while every url of the website is controlled by Laravel routes. 我想知道当网站的每个网址都受Laravel路由控制时,如何将该地址指向Wordpress博客。

Create a blog folder on your public directory . 在公共目录上创建一个博客文件夹。 unzip a wordprees installer in blog folder . 在博客文件夹中解压缩wordprees安装程序。 Now if you hit the url example.com/blog then you can see the wordpress installer . 现在,如果您访问网址example.com/blog,则可以看到wordpress安装程序。 Then configure your blog. 然后配置您的博客。

Follow @Avijit Das answer and then Add this line in your .htaccess file 按照@Avijit Das的答案,然后在您的.htaccess文件中添加此行

RewriteCond $1 !^(blog) 

Now it will look something like this 现在看起来像这样

<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>

RewriteEngine On 

RewriteCond $1 !^(blog) 

# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]

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

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

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