4
这是我第一次尝试.htaccess.htaccess重写url获取参数
这就是我想要的。
example.com/account/blitzen12 -> example.com/account/index.php?id=10&name=blitzen12
我不想在重写中包含id,这有可能吗?
Note: id and name which is 10 and blitzen12 is retrive from the database.
到目前为止,这是我试过,但它没有奏效。
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^account/(.*)$ ./account/index.php?page=account&id=$1&name=$2 [L,NC]
html代码。
<a href="account/index.php?id=10&name=blitzen12">blitzen12</a>
任何人都可以帮助我吗?谢谢。
我试过你上面提到的,但它没有奏效。 供参考我会编辑并包含html以及.. – blitzen12
是否可以重写html响应?我不确定它是否被称为出站规则? – blitzen12
@ blitzen12:mod_rewrite适用于_requests_到达服务器;它与HTML没有任何关系。如果您希望HTML中的链接网址具有特定的形式,那么_you_必须确保它们具有这种形式。 – CBroe