我想问一个关于.htaccess
. 我有一个来自 的表单index.html
,并且想将一个值传递给receiver.php
。你如何配置.htaccess
输出http://localhost/demo/receiver/jibberish
而不是http://localhost/demo/receiver.php?fid=jibberish
?
http://{host_name}/demo/index.html
<form method="get" action="receiver.php">
FID <input type="text" name="fid" value="jibberish"> <br>
<input type="submit" value="Submit">
</form>
http://{host_name}/demo/receiver.php
<?php
echo $_GET['fid'];
?>
我很难过。这是我的.htaccess
代码。
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{DOCUMENT_ROOT}/$1 -f
RewriteRule ^/receiver.php$ /receiver.php?fid=$1 [PT]
</IfModule>