I am trying to get URL working for SEO. ID and Title should be included. domain.com/news.php?id=12 to domain.com/news/12/tite-of-news domain.com/news.php to domain.com/news.php However if someone type: domain.com/news/12/ and ignore the tile.. it should still work. This is what I have done: RewriteRule ^news/([0-9]+)$ news.php?id=$1 [L]
Yes, this is a correct way to do it. I would add the ^news/ part back as you had in the first attempt. No reason to leave that out Hope this helps.