N
N
Nikita Paskal2015-08-06 15:37:27
PHP
Nikita Paskal, 2015-08-06 15:37:27

How to make cnc for articles?

Good day to all, please tell me how to send such a link post? id = 1 as follows: post / id / 2 ?
$query = mysql_query("SELECT * FROM news ORDER BY id DESC LIMIT $start, $num ") or die(mysql_error());
$news = mysql_fetch_array($query);
This is how the link is formed More...
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
MK, 2015-08-06
@paskalnikita

make a redirect in htaccess:
and then the link post/id/2 will open post?id=2

T
trevoga_su, 2015-08-06
@trevoga_su

the second link in the search given by the commenter above.
in htaccess we redirect everything to index
there we parse the URL and that's it.
writing a condition for each RewriteRule handler in htaccess is currently a very bad and complicated practice.
the server configuration file should not deal with url conversion

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question