php - How can I send multiple $_GET["x"] variables using htaccess? -
so far but.....
$custom_path= "musical_instruments"; echo '< href='$custom_path' >custom link< /a>'
i'm able use $_get["custom_path"]
in page i'm redirected
rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ localhost/folder/folder/stuff.php?custom_path=$1
how send multiple $_get
variables form custom link can use them in page i'm redirected to?
i did not quite want know:
$custom_path = "category=$category&item_name=$url&item_id=$id";
php
$custom_path= "musical_instruments"; $item_name= "guitar"; $item_id= 123; echo '< 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
how can have access variables $1, $2 , $3 of custom link? doing wrong way i'm building custom link?
not sure want 1 how create valid link use double quotes instead of single qoutes if want use variables inside it.
$custom_path= "musical_instruments"; $item_name= "guitar"; $item_id= 123; echo "< href='?custom_path=$custom_path&item_name=$item_name&item_id=$item_id'>custom link< /a>";
havent tested should trick
rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewritecond %{request_filename} !stuff\.php$ rewriterule ^(.*)$ /folder/folder/stuff.php?%{query_string} [l]
beware might in endless loop , produce 500 error
Comments
Post a Comment