php - 使用 .htaccess 将 Wordpress 子文件夹重定向到 index.php
问题描述
所以我在 Wordpress 和主 Wordpress 目录中有网站,我创建了目录 /w。所以我在主目录目录中
- w
- wp-内容
- wp-管理员
- ...
在 /w 中,我有目录 /app 和 /public。使用 .htaccess 拒绝访问应用程序。现在,在 /public 中,我有文件 index.php 和 .htaccess。我想要做的是将所有网址从mydomain.com/w/something/something2重定向到mydomain.com/w/public/index.php
下面是我在 /w/public 中的 .htacces
Options -MultiViews
RewriteEngine on
RewriteBase /w/public
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?url=$1 [NC,L,QSA]
现在,当我输入 url mydomain.com/w/something 时,我得到了 Wordpress 404 页面。希望some1可以帮助我:)
解决方案
推荐阅读
- amazon-web-services - 无法将端口从 80 更改为 AWS 中的任何其他端口
- html - 使用容器流体时第 3 列的对齐
- oracle - Oracle在Docker中运行时如何调试存储过程?
- javascript - 如何在 React-Native 中使用带返回的全局函数?
- sql-server - 如何在 SQL Server 中显示日期期间?
- ios - 在 tableView 中更改从 JSON 获取的多条记录 | 迅速
- mongodb - 使用句点运算符查找猫鼬查询
- sql - 查询以在多个列中搜索单个值
- ruby-on-rails - 测试 ActionController::RoutingError: 未初始化的常量 V1::LocationsController
- oracle - 查看列是否存在的函数