Htaccess, getting a 404 error

In my web server there are the following folders:

/
/forums/

On / there is an htaccess (please look at the bottom, I call it main htaccess), that does the following:

So when somebody entered (www).mydomain.com was redirected to (www).mydomain.com/forums (but on the address bar was appearing just or mydomain.com.).

And it was working fine, perfectly...



Then for some other reasons I had to add an htaccess to the /forums/ folder (see below, I call it forum htaccess), and from this moment on I get a 404 error when I try to enter the following URLs:

mydomanin.com
www.mydomain.com

What still continues working is:
mydomain.com/index.php
www.mydomain.com/forums
mydomain.com/forums



I would like the redirect of "main htaccess" to work even if I have edited the "forums htaccess"...
but I have no idea how to do it, and what to change...

Thank you
main htaccess
--------------
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?mydomian.com$
RewriteCond %{REQUEST_URI} !^/forums/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /forums/$1
RewriteCond %{HTTP_HOST} ^(www.)?mydomian.com$
RewriteRule ^(/)?$ forums/index.php [L]



forum htaccess
----------------
RewriteEngine On
RewriteRule ^((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]

RewriteCond %{REQUEST_URI} !(admincp/|modcp/|cron|vbseo_sitemap)
RewriteRule ^((archive/)?(.*\.php(/.*)?))$ vbseo.php [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !/(admincp|modcp|clientscript|cpstyles|images)/
RewriteRule ^(.+)$ vbseo.php [L,QSA]

Open in new window

LVL 5
ping_itAsked:
Who is Participating?
 
ping_itConnect With a Mentor Author Commented:
resolved

I had to change:

RewriteCond %{REQUEST_URI} !(admincp/|modcp/|cron|vbseo_sitemap)

to:
RewriteCond %{REQUEST_URI} !(admincp/|modcp/|cron|vbseo_sitemap|index)
0
 
HackneyCabConnect With a Mentor Commented:
What do your Apache error logs say? That should tell you which of these rewrites is being requested and causing the 404 "not found" to arise.
0
 
ping_itAuthor Commented:
The logs are saying:


[Sun Apr 18 15:29:13 2010] [warn] RewriteCond: NoCase option for non-regex pattern '-f' is not supported and will be ignored.
[Sun Apr 18 15:29:13 2010] [warn] RewriteCond: NoCase option for non-regex pattern '-d' is not supported and will be ignored.
0
 
RajneshwarPrasadCommented:
First try executig the code as windows/Apache Administrator. Also note that a change in Apache might require a restart.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.