CNC using mod_rewrite?

Please tell me how using mod_rewrite to make CNC look site.ru/news/1-nazvanie_dlinnoe/
ie /news/ID-SLUG/

Did this:
RewriteRule ^news/([0-9]+)-([a-z]+)/$ /news.php?id=$1&slug=$2 [L,QSA]

Have a question, as that would make the link worked with no parameters, ie just site.ru/news/
Thank you.
July 12th 19 at 19:27
2 answers
July 12th 19 at 19:29
before this rule something like that you need to addRewriteRule ^news/$ /news.php [L,QSA]
July 12th 19 at 19:31

Find more questions by tags PHPProcessing URL