2

Prolly an easy one.. I am trying to study up on mod_rewrite and ran into an issue

Here is my url

example.com/index.php?id=1&title=some_title

I want the page to be able to take

example.com/1/some_title.html

How would I do that?

Ben
  • 1,382
  • 10
  • 14
Greg Alexander
  • 1,192
  • 3
  • 12
  • 25

2 Answers2

7
RewriteEngine on
RewriteRule ^(\d+)/(\w+).html$ index.php?id=$1&title=$2
2
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*)/(.*)\.html$ index.php?id=$1&title=$2                   
Sujit Agarwal
  • 12,348
  • 11
  • 48
  • 79