Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/15.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 将特定URL重写为另一个特定URL_Apache_Mod Rewrite - Fatal编程技术网

Apache 将特定URL重写为另一个特定URL

Apache 将特定URL重写为另一个特定URL,apache,mod-rewrite,Apache,Mod Rewrite,我最近将Joomla安装升级到1.7。因此,链接系统现在不同了。我的客户有一个FLASH横幅,在FLASH内有特定链接,无法访问原始.fla进行编辑 我想做的是将链接URL从横幅重写为文章id 我的.htaccess中有以下内容,但它没有重定向,我得到一个404错误 RewriteEngine on RewriteRule ^index.php?option=com_content&view=article&id=25$ index.php?option=com_content&

我最近将Joomla安装升级到1.7。因此,链接系统现在不同了。我的客户有一个FLASH横幅,在FLASH内有特定链接,无法访问原始.fla进行编辑

我想做的是将链接URL从横幅重写为文章id

我的.htaccess中有以下内容,但它没有重定向,我得到一个404错误

RewriteEngine on
RewriteRule ^index.php?option=com_content&view=article&id=25$ index.php?option=com_content&task=view&id=25&Itemid=59 [L]

谢谢!非常感谢您的帮助。

您无法在RewriteRule中匹配查询字符串,您必须在RewriteCond中使用%{query\u STRING}变量,如下所示:

RewriteEngine on
RewriteCond %{QUERY_STRING} ^option=com_content&view=article&id=25$
RewriteRule ^index.php$ index.php?option=com_content&task=view&id=25&Itemid=59 [L]

谢谢,我会试试的。