This is an example of an error in out log file:

File does not exist: /var/www/website/female, referer: http://www.example.com/female/dresses/A-Dress-Black

/female does not physically exist, because we use friendly URLs via our .htaccess file which looks like this:

RewriteEngine On # Turn on the rewriting engine
RewriteBase /
RewriteCond %{http_host} !^www.website.com$ [nc]
RewriteRule ^(.*)$ http://www.website.com/$1 [r=301,nc,L]
RewriteRule ^News/?$ news.php [NC,L]
RewriteRule ^About/?$ about.php [NC,L]
RewriteRule ^Contact/?$ contact.php [NC,L]
RewriteRule ^Sign-In/Create-Account?$ sign_up_in.php [NC,L]
RewriteRule ^Logout?$ sign_up_in.php?l=1 [NC,L]
RewriteRule ^Your-Bag?$ your_bag.php [NC,L]
RewriteRule ^Help?$ help.php [NC,L]
RewriteRule ^Profile?$ profile.php [NC,L]
RewriteRule ^Create-Profile?$ profile_create.php [NC,L]
RewriteRule ^([A-Za-z-]+)/([A-Za-z-]+)/([A-Za-z0-9-]+)/?$ store_focus.php?sex=$1catName=$2&permalink=$3 [NC,L]
RewriteRule ^([A-Za-z-]+)/([A-Za-z-]+)/page/([0-9]+)/?$ store.php?sex=$1&catName=$2&page=$3 [NC,L]
RewriteRule ^([A-Za-z-]+)/([A-Za-z-]+)/?$ store.php?sex=$1&catName=$2 [NC,L]
RewriteRule ^([A-Za-z-]+)/?$ store.php?sex=$1 [NC,L]

Every request for a page results in an error even though the site works fine. Has anyone encountered this before?

  • I still haven't got to the bottom of this... really annoying!
    – Samuurai
    Commented Jan 18, 2011 at 10:12
  • 1
    Asked April 2010 .. Last answer Feb 2011, OP's last comment dated March 2011 .. and still no solution? Doh. 1) There is missing & in ITEM rule: store_focus.php?sex=$1catName= should be store_focus.php?sex=$1&catName= 2) Individual pages rewrite rules have missing / before ?: ^Profile?$ should be ^Profile/?$
    – LazyOne
    Commented Jul 9, 2011 at 10:16

5 Answers 5


You are trying to match a path that starts with a letter or number, but it starts with a '/'. Your rules should be something like

RewriteRule ^/([A-Za-z0-9-])/...$      ...

Alos, do you have access to the logs? If so, enable the logs for mog_rewrite

RewriteLog /some/path
RewriteLogLevel 3
  • Unfortunately It gives me an error when I add a "/". Do you really need the "/" if you have RewriteBase = "/" ---- The requested URL /female/just-arrived/page/1 was not found on this server.
    – Samuurai
    Commented Apr 15, 2010 at 9:44
  • I do not think RewriteBase does what you think... Try remove it.
    – Dan Andreatta
    Commented Apr 15, 2010 at 10:17
  • No difference, damn!
    – Samuurai
    Commented Apr 15, 2010 at 11:03
  • Edited my answer with more ideas
    – Dan Andreatta
    Commented Apr 15, 2010 at 11:49
  • Ah good idea.. didn't realise you could log rewrites. I've got the log here: Just trying to make some sense of it.
    – Samuurai
    Commented Apr 15, 2010 at 11:59

If your Rewrite rules are in an .htaccess file, you need to have at least

AllowOverride FileInfo

in your apache configuration.

And you also need to have

Options FollowSymLinks

If your server configuration has

AllowOverride FileInfo Options

(or AllowOverride All) then you can also add Options FollowSymlinks to the .htaccess file.

  • I don't use .htacces..All options are set in the VHost.
    – Samuurai
    Commented Mar 3, 2011 at 13:20
  • The OP has stated that "the site works fine", so the .htaccess rules must already be working satisfactorily. If the problem was to do with AllowOverride or Options then the site wouldn't work at all.
    – MrWhite
    Commented Nov 25, 2020 at 19:29

There is a decent chance that the error doe not come from the page itself but rather from an element on the page.

Example: <img src="img/bla.jpg"/> would point to /female/dresses/img/bla.jpg instead of /img/bla.jpg.

Because the server first checks for the female folder when it's searching for the bla.jpg, it will never give the error on the element itself

  • Thank you! I had the same problem and in my case it was because the web browser was searching for the favincon.png file with a relative path. Commented Aug 9, 2013 at 9:58
  • "There is a decent chance that the error doe not come from the page itself" - although the URL quoted in the error log would seem to be the "page itself"?
    – MrWhite
    Commented Nov 25, 2020 at 19:30

Been a while since I used Apache or wrote any Rewrite Rules, but are trying to match any number of A-Za-z and - do you not need to escape the last - "-"

or is the last - doing something special I would guess that's your problem if your trying to match -'s

RewriteRule ^([A-Za-z-]+)/([A-Za-z-]+)/([A-Za-z0-9-]+)/?$ store_focus.php?sex=$1catName=$2&permalink=$3 [NC,L]
  • Hmm, that's not it. The hyphen can be anywhere outside of a range, unescaped.
    – Samuurai
    Commented Apr 14, 2010 at 14:18
  • Sometimes the log just looks like this: [Wed Apr 14 15:18:37 2010] [error] [client] File does not exist: /var/www/website/female
    – Samuurai
    Commented Apr 14, 2010 at 14:19
  • another thing I notice is that you are looking for something that begins with a letter or - <pre>^([A-Za-z-]+)</pre> after a quick glance as the rewrite docs at httpd.apache.org they look like that all start by looking for a / the one after the domain name. You are not trying to find this first /
    – Alistair Prestidge
    Commented Apr 14, 2010 at 14:37
  • so you think it should be RewriteRule ^/([A-Z......... ?
    – Samuurai
    Commented Apr 14, 2010 at 15:33
  • "The hyphen can be anywhere outside of a range, unescaped." - yes, at the start or end of the character class.
    – MrWhite
    Commented Nov 25, 2020 at 19:36

I have the same problem. A work-around is to create the directory that is reported to be missing.

mkdir /var/www/website/female

Once it gets past the directory check, the RewriteRule will probably work. It's a mystery to me why it first checks the existence of the directory.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.