I just set up Apache and PHP on a server running CentOS by using something along the lines of yum install httpd
and yum install php
.
I've created the following file in /etc/httpd/conf.d/vhosts.conf
:
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName dl.domain.com
ServerAlias dl.domain.com
DocumentRoot /var/www/dl.domain.com/html
ErrorLog /var/www/dl.domain.com/logs/error.log
CustomLog /var/www/dl.domain.com/logs/access.log combined
</VirtualHost>
Not that it isn't actually domain.com
, it's the actual domain that I'm using.
Then, in /var/www/dl.domain.com/html/.htaccess
I have the following:
RewriteEngine On
# RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]
The problem is I'm getting 404 not found errors when accessing a URL like http://dl.domain.com/something/somethingelse
. The requests don't seem to be going through the index.php
script which the .htaccess
file tells them to.
I've tried setting RewriteBase
to /var/www/dl.domain.com/html/
but still no luck.
I have the same thing set up on localhost for development and it works perfectly. Can anyone spot what might be going wrong here?