问题
I have htaccess
tha handle redirections know i want to hit api like i have a url like that
http://localhost:8080/test/network/country/category/subcategory/fixedvalue
I have fixed value like detail, category ,codes
but only in case of detail
i need id
as parameter
example
http://localhost:8080/test/Airtel/UK/Prepaid/5G/Detail
below is redirect url that i want to generate from htacess file
if fixed value is detail
http://localhost:8080/h1.php?network=Airtel&country=UK&category=Prepaid&subcategory=5G&Detail=remain portion of url except .html
in other cases where detail is not in fixed i don't need id
that have parameter the remaining portion of url after 5th parameter so url will be
http://localhost:8080/h1.php?network=Airtel&country=UK&category=Prepaid&subcategory=5G
here is a code that redirect to 5.php
file so that but i want not redirection i want a specific url having parameter
RewriteEngine On
RewriteRule ^([\w-]+)/([\w-]+)/([\w-]+)/([\w-]+)/([\w-]+)/?$ 5.php?1=$1&2=$2&3=$3&4=$4&5=$5 [QSA,L]
in simple from
www.cloth.com/nike
to www.cloth.com?name=nike
来源:https://stackoverflow.com/questions/41634835/how-to-change-change-url-format-to-post-using-htacess-php