Forum Moderators: phranque
CASE:
I want to have the url
1> http://example.com/admin -> admin/index.php?q=admin/login
(Note: if there is no any segment after admin it should be routed to admin/login)
2> http://example.com/admin/any -> admin/index.php?q=admin/any
And I performed the following for the url rewriting
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^admin\/(.*)$ admin/index.php?q=admin/$1 [QSA,L]
this is only working for 2> case
i would like to know how to handle for case 1> too ?
Any idea?
Thanks
[edited by: jdMorgan at 3:00 pm (utc) on Feb. 17, 2009]
[edit reason] example.com [/edit]
# If requested URI-path does not resolve to an existing file on disk
RewriteCond %{REQUEST_FILENAME} !-f
# And if requested URI-path does not resolve to an existing directory
RewriteCond %{REQUEST_FILENAME} !-d
# Rewrite any URL-path beginning with "admin/" and ending with <anything or nothing>
# to "admin/index.php?q=admin/<anything or nothing>"
RewriteRule ^admin\/(.*)$ admin/index.php?q=admin/$1 [QSA,L]
Jim