How to change change URL format to POST using htacess php?

ε祈祈猫儿з 提交于 2020-01-03 02:47:08

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!