到目前为止一切都很好,但是......
$custom_path= "musical_instruments";
echo '< a href='$custom_path' >custom link< /a>'
我可以$_GEt["custom_path"]
在我被重定向的页面中使用
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ localhost/folder/folder/stuff.php?custom_path=$1
如何从$_GET
自定义链接发送多个变量,以便我可以在重定向到的页面中使用它们?
我这样做了,但不是我想知道的:
$custom_path = "category=$category&item_name=$url&item_id=$id";
php
$custom_path= "musical_instruments";
$item_name= "guitar";
$item_id= 123;
echo '< a href='$custom_path&$item_name&$item_id' >custom link< /a>'
htaccess
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ localhost/folder/folder/stuff.php?custom_path=$1&item_name=$2&item_id=$3
如何访问自定义链接的变量 $1、$2 和 $3?我在构建自定义链接的方式上做错了吗?