I've got a site with the following .htaccess rule:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?id=$1
</IfModule>
It works great but I need to expand it so that IF there is another path taken by the user, I can forward it (but the root path should still work). I tried this, but the site just keeps processing the first RewriteRule:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?id=$1
RewriteRule /^(.*)$/^(.*)$ /$1.php?id=$2
</IfModule>
Any ideas?
So the root page could be
- domain.com/doug so this is /index.php?id=doug
- domain.com/dave so this is /index.php?id=dave
The inner path could be
- domain.com/group/object1 so this is /group.php?id=object1
- domain.com/group/object2 so this is /group.php?id=object2
- domain.com/admin/login so this is /admin.php?id=login