I want to rewrite URLs as domain.com/page using .htaccess where page is a variable.
I am using the following code for it:
RewriteRule ^(.*)$ index.php?room_name=$1 [L]
But it isn't working as desired. I think it is making all URLs like domain.com/login or domain.com/register act as the variable page.
How do I rewrite the URL such that the variable page rewrites only for index.php?
Edit: If domain.com/page is not possible, domain.com/room/page is also acceptable.
Edit 2: I have been using the following URL rewrites for this purpose earlier:
RewriteRule ^teen index.php?room_name=teen [L]
RewriteRule ^singles index.php?room_name=singles [L]
But as these pages are supposed to be user generated it is not possible to write for every page. I just want to automate these URL rewrites.