We are running apache2 v2.2.22 on openSuSE 12.2. We have one website defined with the files at /srv/www/htdocs. This is replacing an older version that we had in place for alpha testing. With the old system, users had to enter in the directory (ie.
www.mydomain.com/startlocation) where the index file is.
On the new server, we just want them to enter in
www.mydomain.com without the subdirectory. However, for the team that tested the old system, we would like that the old url with the subdirectory would still work for them. This way if someone entered in
www.mydomain.com/startlocation, it would get redirected to
www.mydomain.com. I have been asked to allow anything after the domain name and redirect it to the root.
After some research, I decided to try out mod_rewrite. In some searches on its use, the following lines should be added to .htaccess under the root directory. I created the file and entered in the following as its contents:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f [OR]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*)$ http://www.mydomain.com/=$1 [R=301,L]
I restarted apache2, but it did not work. I ensured that mod_rewrite was installed by using the apache2ctl -M command.
What am I missing?
Thanks in advanced