Link to home
Start Free TrialLog in
Avatar of bennybutler
bennybutler

asked on

mod rewrite question

Ok, I have a mod_rewrite that someone did for me.

Right now, if anyone hits website.com/mynamehere/
And if it doesn't exist, it sends them to
/control.php?reseller=mynamehere

I need it to instead behave like:
website.com/a/mynamehere go to website.com/credit/?aff=mynamehere

I'm just adding a subdirectory, and sending to a different page.  But my regex'n skills don't exist.
RewriteEngine on
       # is not a directory
       RewriteCond /www/wse/$1/ !-d
       # the A-Z is being caught by the NC flag (compiles the regEx case-intensive)
       RewriteRule ^/([a-z0-9_-]+)/$ /$1 [NC,R=301,L]
 
       # is not a directory
       RewriteCond /www/wse/$1/ !-d
       # the A-Z is being caught by the NC flag (compiles the regEx case-intensive)
       RewriteRule ^/([a-z0-9_-]+)$ /control.php?reseller=$1 [NC,L]

Open in new window

Avatar of caterham_www
caterham_www
Flag of Germany image

> I'm just adding a subdirectory

variable or or a fixed one for all links?
ASKER CERTIFIED SOLUTION
Avatar of arober11
arober11
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial