Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试为要解析的以下 URL 编写一个 htaccess 文件。
/folder/title-of-article/id=6
传递给-
/page.php?id=6
我该怎么做呢?
假设您的文章标题不能包含斜杠,您可以使用:
RewriteEngine On RewriteRule ^folder/[^/]+/id=([0-9]+)$ /page.php?id=$1
这将匹配/folder/<anything not containing slashes>/id=<digits>
/folder/<anything not containing slashes>/id=<digits>