RewriteRule Help

Hey everyone,

Since every time when I needed some help with Rewrites I found some great help here…
So, here is what I have:

RewriteEngine On
# redirect all non-www traffic
RewriteCond %{HTTP_HOST} ^wowjuju\\.com$

#Repcalc rule
RewriteRule ^repcalc/?$ index.php?app=ccs&module=pages&section=pages&page=repcalc [NC,L]

Options -MultiViews
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

#Stop the access here
<Files conf_global.php>
Order allow,deny
Deny from all

The Problem:
The first RewriteRule is not working. If i move it after the second RewriteRule it works only that and everything else gives me 404 errors.

I’m pretty sure I have problems with the flags but I couldn’t figure it out :frowning:

Thanks everyone in advance for your help!

The RewriteCond you have there is used for the first RewriteRule. That is, the first RewriteRule will only fire if the first RewriteCond is true.

So, if you’re not requesting (but [noparse][/noparse] or any other subdomain), the first RewriteRule will not fire.

Seems to me there was another RewriteRule directly after the RewriteCond to redirect non-www to www and you removed that rule but forgot to remove the RewriteCond?

Heh, I never expected that. I removed the first RewriteCond and everything works as it should.

Thanks a lot.