lucy24 - 7:28 pm on Apr 20, 2013 (gmt 0)
if you are on 2.2 you can use the RewriteLog Directive:
Context: server config, virtual host
I knew there had to be a catch :(
I can try it on MAMP for my own edification, but not on the live site.
I also noticed that the initial version of my htaccess (first post) DOES match the URL http://www.example.com/thema-s/bedrijfsuitje/schadelijk-bedrijfsuitje if I stick a / to the end. I am not so good at regexes, but does this sound logical to you?
Yes, perfectly logical. The rule says "ends in directory slash"; you feed in a request for filename ending in directory slash; rule executes.
The problem is... In real life, an URL that ends in a slash is a directory. An URL that doesn't is a page. In your case it is a little bit academic since none of the pages physically exist. But you need to pick a form and stick with it. If all your URLs end in a slash, then you're pretending that each page is its own directory. If all your URLs don't end in a slash, then you need to tweak your code to allow for extensionless URLs.
Now, personally I don't approve of extensionless URLs, but this is purely an individual preference. Nothing to do with either Apache or SEO. Going extensionless is definitely easier to code for, because then all page names can be expressed as
If it has an extension, it's a supporting file-- image, css etc --and the rules can bypass it. You can run the -d test if you like, but you can skip -f because you already know there is no file with a name in the form "abcefg" and that's all.
This is assuming for the sake of discussion that none of your directory names contain literal periods. A period in an URL is not illegal, of course, but they're an amazingly bad idea. So unless your name is apache dot org, don't use them. Stick with alphanumerics. (People can fight about hyphens and lowlines, but that's for a different forum.)
Finally: This is a virtual-host setup, so you can do config-file things. But you've also mentioned htaccess. When you're first setting up the site, it can be very useful to have htaccess files-- that is, AllowOverrides is enabled. You can change things on the fly without having to restart the server, because htaccess is instant.
But once you've got everything stabilized, see if you can turn off the AllowOverrides directives-- or at least most of them-- and shift all the htaccess rules to <Directory> sections within the config file. This way everything runs faster because each request only makes one stop: the config file.