Symbolic links not working on apache 2.2

105 Views Asked by At

I am experiencing a strange issue regarding displaying symbolic links. I have copied existing working code from my development environment, to a test environment. Looking at the code it should work. This makes me think that the issue might be elsewhere but I do not know where to look.

  • I am using Apache 2.2 on a CentOs 5.8 machine

  • All files and folders under document root including root folder is owned by apache

This are the lines of code in the vhost file

RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}/$1.php -f
RewriteRule ^([a-zA-Z0-9_-]+)/?$ /$1.php [QSA]

When I go to http://example.com/home

I get this error in the error log:

File does not exist: /var/www/my_document_root_folder/home

If I add .php to the URL it works:

http://example.com/home.php

The exact same RewriteRule works fine in my development environment. Could the issue be somewhere else and not in the actual RewriteRule?

I copied my development vhost file to this test environment. I only changed the ServerName, DocumentRoot, ErrorLog paths etc.

Any help is much appreciated, it's driving me bonkers.

-M

1

There are 1 best solutions below

0
On

I have answered my own question. It turns out that I made a spelling error on one of the the paths. Once I fixed that everything works fine. Feeling a bit stupid right now :(

-M