【问题标题】:Combine Laravel and Wordpress via htaccess通过 htaccess 结合 Laravel 和 Wordpress
【发布时间】:2015-02-22 16:25:08
【问题描述】:

我有一个标准的 Larvael 文件夹结构,我想在 /blog 文件夹中有一个 Wordpress 博客。
我在共享软管上,所以我在我的域的根目录下使用这个 htaccess 来重写所有对 /public 的请求:

RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/$1 [L]

然后我想我会将博客放在根目录中,如果路由以博客开头,则不进行重写:

RewriteCond %{REQUEST_URI} !^public
RewriteCond %{REQUEST_URI} !^blog
RewriteRule ^(.*)$ public/$1 [L]

但这没有用。
我怎样才能做到这一点?

谢谢,
佩塔尔

【问题讨论】:

    标签: php wordpress .htaccess laravel


    【解决方案1】:

    然后:

    RewriteCond %{REQUEST_URI} !^/public
    RewriteCond %{REQUEST_URI} !^/blog
    RewriteRule ^(.*)$ public/$1 [L]
    

    因为 URI 以 / 开头

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-02-19
      • 2011-10-24
      • 2014-10-28
      • 2013-05-15
      • 1970-01-01
      • 1970-01-01
      • 2013-01-26
      • 1970-01-01
      相关资源
      最近更新 更多