使用 mod_rewrite 将路径转换为查询字符串变量
我正在尝试让 Apache 发送:http://mydomain.com/这些/are/arguments/mmmk
至:http://mydomain.com/?pages=这些/are/arguments/mmmk
这样 $_GET['pages']
将显示 这些/are/参数/mmmk
。
我已将“AllowEncodedSlashes”设置为“开”。
该规则需要能够处理尾部斜杠,并且当没有子页面(例如 http://mydomain.com
)时,
有人知道如何完成此任务吗?
I am trying to make Apache send:http://mydomain.com/these/are/arguments/mmmk
to:http://mydomain.com/?pages=these/are/arguments/mmmk
Such that $_GET['pages']
will display these/are/arguments/mmmk
.
I have set 'AllowEncodedSlashes' to On.
The rule needs to be able to handle trailing slashes, and when there is no subpages (like http://mydomain.com
)
Does anyone know how to accomplish this task?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为了不重写图像/脚本,您需要首先确保 .htaccess 文件中不存在该文件或目录
In order to not rewrite images/scripts you'll need to make sure the file or directory does not exist first in your .htaccess file