husker475
asked on
Mod Rewrite: Multiple redirections, check if numeric
Hi all.
I would like to redirect numeric values to one site1.php and the rest to site2.php
For example:
www.mydomain.com/123 should be directed internally to www.mydomain.com/site1.php?id=123
www.mydomain.com/1234 to www.mydomain.com/site1.php?id=1234
www.mydomain.com/abc to www.mydomain.com/site2.php?name=abc
www.mydomain.com/abc12 to www.mydomain.com/site2.php?name=abc12
This is what I've got so far:
I would like to redirect numeric values to one site1.php and the rest to site2.php
For example:
www.mydomain.com/123 should be directed internally to www.mydomain.com/site1.php?id=123
www.mydomain.com/1234 to www.mydomain.com/site1.php?id=1234
www.mydomain.com/abc to www.mydomain.com/site2.php?name=abc
www.mydomain.com/abc12 to www.mydomain.com/site2.php?name=abc12
This is what I've got so far:
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule (.*) http://www.domain.com/site1.php?name=$1 [L]
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER