0

我有一个这样的网址:

localhost/site/index.php?option=com_cust&tool=edit

我想替换index.php?option=com_cust&tool=editedit. 这可能吗?我所做的尝试不起作用,例如:

RewriteEngine On
RewriteRule ^index.php?option=com_cust&tool=edit localhost/site/edit [L,QSA,R=301]
4

1 回答 1

1
RewriteRule ^site/edit site/index.php?option=com_cust&tool=edit [L]

你把它倒过来了 - 重写模块所做的是它接受用户输入的内容(在本例中为“编辑”)并将其转换为您的服务器可以理解的内容(加载 index.php 并将一堆变量传递给它)。

此外,您绝对不想要外部重定向,更不用说 301 重定向了。'L' 应该是您在这里需要的唯一标志。

于 2012-05-10T21:51:49.307 回答