How to use url rewrite with parameters
example.com/news.php?id=1 to example.com/news/1
And the value of number will change dynamically.
How to use url rewrite with parameters
example.com/news.php?id=1 to example.com/news/1
And the value of number will change dynamically.
Yes, there are many similar questions. But here is how to do it.
RewriteEngine On
RewriteRule ^news/([0-9]+)/?$ news.php?id=$1 [NC,L]
You should have mod_rewrite enabled in your server.
RewriteEngine On
RewriteRule ^news/([0-9]*)$ /news.php?id=$1 [L]