wordpress - Wordpress 多站点 Htaccess 覆盖
问题描述
我正在尝试重写一个基本的文件夹,以覆盖 Wordpresses 默认的 htaccess。
我需要一个位于 domain.com/community/sso/index.php 的文件夹来强制解析为 domain.com/community/sso
这是我最近尝试的:
Options -MultiViews
RewriteEngine On
RewriteRule ^community - [L]
RewriteBase /
RewriteCond %{REQUEST_FILENAME} .*\.(jpeg|jpg|gif|png)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . /public/404.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /sso/index.php [L]
</IfModule>```
解决方案
您能否尝试在此处更改您当前规则的顺序(基于您的节目规则),无法测试它。请确保在测试您的 URL 之前清除浏览器缓存。
Options -MultiViews
RewriteEngine On
RewriteRule ^community - [NC,L]
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ /sso/index.php [L]
RewriteCond %{REQUEST_FILENAME} .*\.(jpeg|jpg|gif|png)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ /public/404.php [L]
推荐阅读
- azure - 通过 API 将测试结果链接到 Azure Devops 中的版本
- css - Angular 9 - ngClass 在生产环境中无法正常工作
- c# - 处理 API 的并行 POST
- bash - Bash:计算一个单词在给定文件夹的所有文件中包含多少次
- python-3.x - Python如何从excel电子表格中正确定位熊猫字典
- javascript - 基于是否显示 div 的 Css 背景颜色更改
- javascript - 如何从响应头中获取 JWT 令牌?
- c# - C# WinForms 将光标移动到其他屏幕
- powerbi - PowerBI 打开/关闭循环依赖
- visual-studio-code - 如何在 VSCode 中运行 Spark 批处理作业