Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.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重写并重定向双参数动态URL到静态URL,_Apache_.htaccess_Mod Rewrite_Url Rewriting_Http Redirect - Fatal编程技术网

Apache 试图用.htaccess重写并重定向双参数动态URL到静态URL,

Apache 试图用.htaccess重写并重定向双参数动态URL到静态URL,,apache,.htaccess,mod-rewrite,url-rewriting,http-redirect,Apache,.htaccess,Mod Rewrite,Url Rewriting,Http Redirect,我正在尝试重写和重定向博客的 到,这样,如果在地址栏中输入上述任一URL,它将重定向到第二个URL RewriteEngine on #redirect from "/page.php?fid=123&name=title of the blog" to "/name/title-of-the-blog.jsp" RewriteCond %{THE_REQUEST} /page\.php\?fid=([^\s]+)&name=(-[^\s]+)$ [NC] RewriteRul

我正在尝试重写和重定向博客的


,这样,如果在地址栏中输入上述任一URL,它将重定向到第二个URL

RewriteEngine on

#redirect from "/page.php?fid=123&name=title of the blog" to "/name/title-of-the-blog.jsp"
RewriteCond %{THE_REQUEST} /page\.php\?fid=([^\s]+)&name=(-[^\s]+)$ [NC]
RewriteRule ^name/%2.jsp? [NC,L,R]
#Rewrite /name/title-of-the-blog.jsp to /page.php?fid=123&name=title of the blog
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^name/(-[^/]*)\.jsp$ /reply_forum.php?fid=$1&urdu=$2 [NC,L]
它不起作用,如果有人能检查上面的代码就好了。
谢谢。

重写规则^name/-1$.jsp?[NC,L,R]
无效(缺少模式)。但是
重写规则^name/%2.jsp?[NC,L,R]
有效(注意
^
名称之间的空格)。不确定
-1$
是什么,有。。。应该是
%2
。名称是动态键吗?是,它是动态键,不是值。