R
R
root092016-04-21 12:15:34
PHP
root09, 2016-04-21 12:15:34

cnc via mod_rewrite?

Please tell me how to make a CNC through mod_rewrite site.ru/news/1-nazvanie_dlinnoe/
i.e. /news/ID-SLUG/
I did it like this:
RewriteRule ^news/([0-9]+)-([az] +)/$ /news.php?id=$1&slug=$2 [L,QSA]
I have a question how to make the link work without parameters, i.e. just site.ru/news/
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
MetaDone, 2016-04-21
@MetaDone

you need to add something like this before this ruleRewriteRule ^news/$ /news.php [L,QSA]

T
ThunderCat, 2016-04-21
@ThunderCat

Single point of entry , routing

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question