Answer the question
In order to leave comments, you need to log in
How to make a link prettier?
I usually do this:
index.php:
news.php:
Get record from database by url, url itself $_GET['a']
The link looks like this:
And I would like to know how to convert this to a type
Without OOP.
Please tell me if there are articles or something else.
<a href="news?a=test"></a>
https://site.com/news?a=test
https://site.com/news/test
Answer the question
In order to leave comments, you need to log in
You can do it through .htaccess using this help.
As a result, you should get a similar rule:
RewriteRule ^news/(\w+?)$ /news/a?=$1 [L]
in this case, just use the same file and the same code, but specify /news/test in the layout
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question