htaccess 将 laravel 路由重写为 lv.php,将 wordpress 路由重写为 index.php

时间:2021-01-23 17:41:38

标签: wordpress laravel .htaccess

我已经用 laravel 配置了 wordpress 站点。

对于配置: 在 public 文件夹中,我创建了 wp 文件夹并将所有 wordpress 文件保存在其中。我已将 laravel index.php 文件重命名为 lv.php 并将 wordpress index.php 文件保存在公共文件夹中。

现在我想从 index.php 路由每个 wordpress 路由,从 lv.php 路由每个 laravel 路由。

我想使用 wordpress 运行前端网站页面,例如主页、功能和好处。

我使用了以下 htaccess 文件。它正在重写一些到 Laravel 索引文件的路由。我想反转它。

谁能帮帮我。 示例网址: WordPress:

https://example.com/

https://example.com/features

https://example.com/benefits

https://example.com/package

Laravel:

https://example.com/packages/plan/2

https://example.com/admin

https://example.com/login

https://example.com/client


# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(packages/plan|login|logout|admin|signin)(|\/) /lv.php [L]
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress`

0 个答案:

没有答案