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=myna mehere
I need it to instead behave like:
website.com/a/mynamehere go to website.com/credit/?aff=my namehere
I'm just adding a subdirectory, and sending to a different page. But my regex'n skills don't exist.
Right now, if anyone hits website.com/mynamehere/
And if it doesn't exist, it sends them to
/control.php?reseller=myna
I need it to instead behave like:
website.com/a/mynamehere go to website.com/credit/?aff=my
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]
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
variable or or a fixed one for all links?