I'm writing a mod_rewrite rule and would like a hand making it do what I want.
Basically I want the following cases to work:
request | Redirect to
---------------------
cheese | /?page=cheese
abc123 | /?page=abc123
abc/def | /?page=abc/def
a/b/c/d | /?page=a/b/c/d
(Any alphanumeric plus . - / and _ redirected)
With two special cases:
request | Redirect to
------------------------
admin | don't redirect
media | don't redirect
With these two I don't want any sub directories etc to redirect either.
I've got as far as:
RewriteRule ^([A-Za-z0-9-_]+)/$ /index.php?page=$1 [L]
But this only satisfies the top two tests.
Any ideas?