Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/9.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重写_Apache_.htaccess_Mod Rewrite_Url Rewriting_Permalinks - Fatal编程技术网

Apache htaccess中的URL重写

Apache htaccess中的URL重写,apache,.htaccess,mod-rewrite,url-rewriting,permalinks,Apache,.htaccess,Mod Rewrite,Url Rewriting,Permalinks,如何通过HTAccess重定向到 *URL中的注册日期和电子邮件地址值将是动态的 我试过 RewriteRule http://www.mywebsite.com/confirm-registration/?registration_date=^([a-zA-Z0-9])\$&email_address=^([a-zA-Z0-9])\$ http://www.mywebsite.com/confirm-registration/?registration_date=$1&emai

如何通过HTAccess重定向到

*URL中的注册日期和电子邮件地址值将是动态的

我试过

RewriteRule http://www.mywebsite.com/confirm-registration/?registration_date=^([a-zA-Z0-9])\$&email_address=^([a-zA-Z0-9])\$ http://www.mywebsite.com/confirm-registration/?registration_date=$1&email_address=$2 [QSA,NC,L]
提前感谢,


~Dipak G.

重写规则仅用于匹配
请求URI
,不包括协议、域名或查询字符串

您可以在root.htaccess中使用此规则:

RedirectMatch 301 ^/confirm-registration/ /blog/confirm-registration

你试过什么吗?@anubhava还没有。你有什么建议吗?你需要做一些研究并展示你自己的一些努力。@anubhava RewriteRule^([a-zA-Z0-9])\$&电子邮件地址=^([a-zA-Z0-9])\$[QSA,NC,L]我尝试过你的答案,但当我在浏览器中打开时,它没有重定向到?注释掉
RewriteCond
行并重新测试。在此处添加一行:
RedirectMatch foo/bar
,然后打开
http://example.com/foo
查看您是否得到
http://example.com/bar
或notOk try:
重定向匹配/确认注册//博客/确认注册
规则此重定向但获取“此网页有重定向循环”-为什么?