简体   繁体   中英

.htaccess redirection with query string to human readable url

I have a url: www.abc.com/change.php .

Parameters value is passed in post through $_POST[param] .

I want to convert it to MVC like url through .htaccess such that:

www.abc.com/change.php with $_POST["height"] redirects to www.abc.com/change/height

and:

www.abc.com/change.php with $_POST["width"] redirects to www.abc.com/change/width .

How should my .htaccess file be changed for it?

I'm pretty sure you can't redirect or rewrite based on the name of a post variable.

Actually that's with .htaccess. If you redirect with php, you can definitely do that but that's not what you asked.

I guess you should also be able redirect/rewrite on get variable names.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM