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,
Asked
Active
Viewed 13 times
0
user6888062
- 353
- 1
- 3
- 16
-
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 Answers
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,877
- 5
- 30
- 51