【问题标题】:How to rewrite directories into query string如何将目录重写为查询字符串
【发布时间】:2018-11-28 03:18:28
【问题描述】:

是的,我的第一个 Stackoverflow 问题!已经存在很多年了,但这个让我着迷。

我有一个网址: https://example.com/site.com/phpBB3/general-f1/things-are-getting-crazy-here-t948-60.html

(我需要先在本地进行测试,这就是我设置它的原因)

我想将 URL 更改为: https://example.com/site.com/phpBB3/viewtopic.php?f=1&t=948&start=60

我在 /example.com/.htaccess 中有我的 .htaccess 文件,内容是:

RewriteEngine On
RewriteRule ([a-z0-9_-]*-f)([0-9]+)\/([a-z0-9_-]*-t)([0-9]+)(-([0-9]+))?\.html$ viewtopic.php?f=$2&t=$4&start=$6 [QSA,NE,L,NC]

我设置了 AllowOverRide 并且启用了重写模块。

这似乎适用于https://htaccess.madewithlove.be/ 但不是在实际站点。我要疯了。我怎么了?

【问题讨论】:

    标签: .htaccess mod-rewrite


    【解决方案1】:
    猜你喜欢
    • 2012-10-18
    • 1970-01-01
    • 2011-10-25
    • 2015-08-05
    • 2014-11-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多