Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache .htaccess目录(和子目录)到查询字符串的转换_Apache_.htaccess - Fatal编程技术网

Apache .htaccess目录(和子目录)到查询字符串的转换

Apache .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

我肯定以前有人问过这个问题,但我找不到答案。我相信这真的很简单。我想要一个像这样的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 ^ /article?handle=%1 [NC,L,R]