0

I want URL to look like www.example.com/chat/91 but really the page is www.example.com/room.php?id=91 I searched online for apache rewrite example but I didn't see any examples in this format to use,

user6888062
  • 273
  • 1
  • 2
  • 13
  • Possible duplicate of [Reference: mod\_rewrite, URL rewriting and "pretty links" explained](http://stackoverflow.com/questions/20563772/reference-mod-rewrite-url-rewriting-and-pretty-links-explained) – Croises Jan 17 '17 at 15:34
  • Can you post what you have tried so far? – Amit Verma Jan 17 '17 at 15:39

1 Answers1

1

Use this RewriteRule in your .htaccess file:

RewriteEngine On
RewriteRule ^chat/([^/]*)$ /room.php?id=$1 [L]

Make sure you clear your cache before testing this.

Joe
  • 4,503
  • 4
  • 28
  • 47