0

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?

1

1 Answer 1

0

Check whether there is a directive in your Apache config and there is AllowOverride. If should be set on All. If it is not there, add it to make sure the .htaccess file is being read.

Wishes,

Mohammad Ali Sharpasand

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .