lucy24 - 3:05 am on Jul 27, 2013 (gmt 0)
404 means that the requested page doesn't exist. By itself this isn't an awfully useful error message, because it doesn't give any information about rewriting.
The 404 might mean that the file named
doesn't exist-- which you already know. (Except, isn't the URL supposed to be something like /testfiles/about ?)
Or it might mean that some kind of rewrite has taken place, but the file
OR, finally, it might mean that everything has happened as intended, but index.php was given a parameter it doesn't know how to handle, so it returned a 404. This is either good or bad, depending on what the parameter was.
In the first two cases, your server logs will show a 404 and the user will see the 404 page. In the third case, server logs will show a 200 but the user's browser will record a 404. The (human) user may or may not see the physical 404 page; it depends on how carefully the index.php page is written. I don't think we are dealing with the third-case scenario here.
It looks as if you have got your blank line in the wrong place. There should be a blank AFTER each RewriteRule, but no blank lines between RewriteCond and RewriteRule. Again, the server does not care about blank lines. (Different from robots.txt, where blank lines do have syntactic meaning.) It is purely for your own benefit. It helps you to see where one ruleset ends and another one begins. (For present purposes, Ruleset = RewriteRule plus accompanying conditions.)
Do your pages now have links in the correct form? <a href = "/about"> or <a href = "/testdir/about"> or whatever you want the final form to be. The redirect is only for insurance against Duplicate Content. It is not an essential part of your rewriting.
Pick some page that really exists on your site. On the local version, not the live site. Let's say you have a real physical file called widgets.html
RewriteRule about /widgets.html [L]
If the RewriteRule works as intended, when you request
the browser's address bar will continue to say "localhost:blahblah/about" but the browser window will show the content of the page
Let me check one other thing to be sure you understand it. In mod_rewrite, any Conditions are listed before the rule they belong to. But even though the conditions are listed first, mod_rewrite will not look at them until it sees that the rule itself might potentially work. So if the rule pattern says
and the server gets a request for blahblah.css, it will not even look at the conditions, and it won't matter if they "fit" or not.
There's another thing you can do on your local WAMP. First shut down the server and make a copy of the config file. Now EDIT the config file-- the real one, not the copy-- to add a RewriteLog:
Restart the server and continue testing. But if mod_rewrite already makes you anxious, logging rewrites may not make you any happier.