Apache .htaccess目录(和子目录)到查询字符串的转换
我肯定以前有人问过这个问题,但我找不到答案。我相信这真的很简单。我想要一个像这样的urlApache .htaccess目录(和子目录)到查询字符串的转换,apache,.htaccess,Apache,.htaccess,我肯定以前有人问过这个问题,但我找不到答案。我相信这真的很简单。我想要一个像这样的url example.com/article/3xamp1e/Some-sort-of-title 并将其转换为 example.com/article?handle=3xamp1e 通过apache中的htaccess重写 这应该有效: RewriteEngine On RewriteCond %{THE_REQUEST} /article/([^/]+)/([^\s]+) [NC] RewriteRule
example.com/article/3xamp1e/Some-sort-of-title
并将其转换为
example.com/article?handle=3xamp1e
通过apache中的htaccess重写 这应该有效:
RewriteEngine On
RewriteCond %{THE_REQUEST} /article/([^/]+)/([^\s]+) [NC]
RewriteRule ^ /article?handle=%1 [NC,L,R]