Answer the question
In order to leave comments, you need to log in
How to write RewriteRule in .htaccess?
There is a file studentPage.php
in the root of the site
There is a
site.ru/studentPage.php?name=ivan
in
site.ru/students/ivan
the
Answer the question
In order to leave comments, you need to log in
bro, I don't remember the htaccess syntax offhand (but Google remembers 100% :) - but I want to correct your question, and maybe this will be the answer for you.
Salt here is not at all in the fact that something "turns" into something.
The point here is
to redirect ANY (you can also set exceptions to the rule) requests to the web server (in your case, Apache) to studentPage.php.
- Send any request to studentPage.php
And, for example, a request comes to the server:
in other words, now you have the value available inside studentPage.php through environment variables " site.ru/students/ivan" - and you can already parse it and do whatever you want with it.
site.ru/students/ivan
but the server, obeying your instructions, sends this a request to be processed by the studentPage.php file (I deliberately wildly simplify so as not to get bogged down in details)
that's the point, not the "transformations" :)
In general, the coder does not need to know this for work at all. It’s better to start learning Laravel right away - the return will be much faster than if you start digging into something that you will never use later. The era of "pure PHP" is gone forever)))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question