+ 1
htaccess PHP
Help me please, I need this: learn-html5/lesson to change on this: learn-html5/overview or learn-html5/basic when I have a link with GET parameter like: sitename/leart-html5/lesson?id=basic
4 Answers
+ 1
What you seem to want is called REST API.
It can be created with PHP only (but will be very difficult, and NOT just one file)
So, there are frameworks like Laravel, CI and more to make the job easier.
Using REST API, you can create custom "Routes" like "learn-html5/path" and path can be anything that is checked by the "Controller" to generate data as per the path.
REST: https://searchmicroservices.techtarget.com/definition/RESTful-API
With just 1 file, like that, it is not possible.
+ 1
Something like this will work:
I don't think you should work with htaccess.
if(isset($_GET['id']){
header("Location: learn-html5/".$_GET['id']);
die();
}
+ 1
Okay, thank you.
I will try it with REST API
0
I work with 1 file where content will be form from database by last parameter in my URL. So, I have only "lesson" file with function of reading URL and it forms content by last parameter