/    Sign up×
Community /Pin to ProfileBookmark

url rewrite problem ??

hello forums !!

CASE:
I want to have the url
1> [url]http://mysite.com/admin[/url] -> admin/index.php?q=admin/login
(Note: if there is no any segment after admin it should be routed to admin/login)
2> [url]http://mysite.com/admin/any[/url] -> admin/index.php?q=admin/any

And I performed the following for the url rewriting

[CODE]RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^admin/(.*)$ admin/index.php?q=admin/$1 [QSA,L][/CODE]

this is only working for 2> case
i would like to know how to handle for case 1> too ?
Any idea?
Thanks

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@ZnupiFeb 16.2009 — Try:
[code]
RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^admin/(.+)$ admin/index.php?q=admin/$1 [QSA,L]
RewriteRule ^admin/$ admin/index.php?q=admin/login [QSA,L]
[/CODE]
×

Success!

Help @PHPycho spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...