dslreports logo
    All Forums Hot Topics Gallery
spc
uniqs
1375

Nordy
join:2007-10-20

Nordy

Member

RewriteRule to send all URLs with mod in them to a directory moderator

How can I write a RewriteCondition / RewriteRule that will send a URL like http://www.example.com/mod/users to a directory called moderator in the root, so no mod_rewriting goes on any further in the .htaccess file that is in the root directory of my project?

What I intend doing, is pass that URL to the folder called moderator, so it can be handled by the RewriteRules in the .htaccess file in that folder, rather than be matched against rules in the main .htaccess folder.

It's all based on the part after the domain name - the /mod/ part

Does anyone know how to write a condition and rewrite rule for this?

Thanks,

GeekNJ
Premium Member
join:2000-09-23
Waldwick, NJ

GeekNJ

Premium Member

I'm no apache/rewrite expert but what should »www.example.com/mod/users be rewritten to? Is it »www.example.com/moderator/users or something different? The re-write in the root directory should be a normal rewrite with an [L] which stops processing more rules and the .htaccess in the moderator subdirectory should do whatever you want that you didn't mention here.