I am also running this version of Ubuntu. You are using the wrong file for httpd...
I also got that file, and it was empty after installing Apache2 (and it's still empty). The "real" config file is
so in your terminal do
and what you SHOULD see is a bunch of commented out stuff. It starts out a full file.
Here's what I ended up doing, because I was imitating my work's VirtualHost setup:
in /etc/apache2/apache2.conf at the BOTTOM I think I UNcommented an Include, so that all my messing around wasn't in the main config file itself but another file that the main config looks at:
When you say "Include path/file" you're telling the main config to act as if you wrote it directly in there, but really it's safely in another file.
Originally Posted by main config
You already have the /var/www thing, great.
Now go check out /etc/apache2/sites-enabled and you should see something called "default" or maybe default with some 0's in there. I'm not sure if the 0's are an Ubuntu thing or maybe an Apache thing? We can refer to the file as "default" though.
(or whatever your text editor of choice is)
There should already be a bunch of text in there, including your <Directory> stuff.
That's any Named virtual host, <virtualhost any>
Originally Posted by default
that Document Root /var/www is why when in your regexes you have / (root) it knows you really mean /var/www/thefilesarehere
I think everything in the middle was already there...
then from "Rewrite engine on" is all added. You turn it on, state where logs are to go, loglevel, etc. I set mine high.
So when I was testing basic mod_rewrite I did this (I don't have PHP, so it was simpler):
each with h1's clearly stating the name of the file (so like you you have with your index.html and .php files)
And a test rewrite was
Where I find by trial-and-error that it only worked if I start with ^/ for the pattern and / before the real file ("/about.html" is referring to "/var/www/about.html" because that's what you've got stated for / in your "default" file).
RewriteRule ^/index(\.html)?$ /about.html [L]
RewriteRule ^/about(\.html)?$ /index.html
Because this isn't an .htaccess file, every time I edit this default file, I then need to
NOT the reload commands you see at apache.org (cause Debian just HAD to be different and weird, didn't they?? this caused me a lot of grief)
sudo /etc/init.d/apache2 reload
try to test your pages and rewrites in your web browser
for example shows about.html
then check your new log ends (the log will get huge fast, so I tail it)
to see what the logs say about your rewrite.
Hope that helped. Dwebian makes Apache a pain when you're getting started. Rich Bowen calls it "Debian-encumbered" lawlz.