Reputation: 481
I have this rewrite rules in my htaccess file:
RewriteRule ^([^/]+)/?$ index.php?id=$1 [QSA]
on index.php i have echo $_GET["id"];
it works fine, so domain.com/services
rewrites to domain.com/index.php?id=services
however if i visit
domain.com/services/service1
the echoed variable is showing 404.shtml
what rule would i need to allow slashes?
Upvotes: 0
Views: 192
Reputation: 12017
It's quite simple. You had set your rule to match anything except slashes. Just allow anything.
RewriteRule ^(.+)/?$ index.php?id=$1 [QSA]
Upvotes: 2