PDA

View Full Version : rewrite exception


boeing747fp
02-21-2010, 08:22 PM
RewriteRule ^([a-zA-Z0-9_-]+)\/?$ showuser.php?username=$1

how do i make this exclude certain folders? for example, right now anything after the .com/ in the URL will process as showuser.php and i need to exclude /blog and /admin from that

koko5
02-22-2010, 07:51 AM
Hi, try :

RewriteCond $1 !^\/(blog|admin)\/?

RewriteRule ^([a-zA-Z0-9_-]+)\/?$ showuser.php?username=$1
Regards

boeing747fp
02-22-2010, 12:42 PM
that didnt work. it still tries to load showuser.php for /admin and /blog

koko5
02-22-2010, 12:48 PM
that didnt work. it still tries to load showuser.php for /admin and /blog
My bad. Removing first slash maybe solving it:

RewriteCond $1 !^(blog|admin)\/?
RewriteRule ^([a-zA-Z0-9_-]+)\/?$ showuser.php?username=$1

boeing747fp
02-22-2010, 12:50 PM
yes that worked. thanks!