【问题标题】:can laravel & wordpress play together?laravel 和 wordpress 可以一起玩吗?
【发布时间】:2015-06-30 12:17:44
【问题描述】:

这是我对 laravel 和 WordPress 的问题:

我需要在laravel 安装中放置一个博客。 我想使用WordPress,但我想不通。 我将 WP 文件放在 public/blog/ 中,但我无法安装它。 重定向是错误部分。 我需要对 Apache 这么说:
  if( $url = public/blog/* ){
     ignore normal laravel routing system & redirect to WordPress inside (public/blog/*)
  }

【问题讨论】:

标签: php wordpress apache laravel


【解决方案1】:

要保持你的 laravel .htaccess 干净,只需使用干净的 url 从任何活动的 wordpress 项目中复制 .htaccess(或查看 wordpress 文档)并将其复制到 public/bloc 中的干净 wordpress 文件夹中(它几乎与 for laravel)。

如果您的博客文件夹中没有 .htaccess,laravel “public/.htaccess”会将所有不特定的现有文件 url 重定向到“public/index.php”

【讨论】:

    【解决方案2】:

    为了解决这个问题,我只是将 laravel 文件夹放在 wpBlog 文件夹旁边。 & 使用命名空间根据使用的 url 将用户重定向到每个命名空间。 所以:-

    blog.website.com : will redirect to the wp blog
    site.website.com : will redirect to the laravel website
    

    【讨论】:

      猜你喜欢
      • 2012-02-06
      • 2015-07-03
      • 1970-01-01
      • 2020-06-17
      • 1970-01-01
      • 2021-12-25
      • 1970-01-01
      • 2016-05-21
      • 1970-01-01
      相关资源
      最近更新 更多