Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a new LAMP CENTOS 5 server I am setting up and trying to copy the configuration from another web server I have. I am stuck with what I think is a mod_rewrite problem. If I go to it correctly routes through some handling code in index.php and shows me a graceful "Page Cannot Be Displayed" message.

But if I go to I get an ugly Apache 404 Not Found error message.

I looked in both httpd.conf files and they both have only one reference to mod_rewrite. LoadModule rewrite_module modules/ So it seems like that should be fine.

At the bottom of httpd.conf I have the code:

<VirtualHost *:80>
  DocumentRoot /var/www/html
  ErrorLog logs/
  CustomLog logs/ common

Then in the root of /var/www/html I have the exact same .htaccess file that looks like this:

RewriteEngine on
Options +FollowSymlinks

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]

ErrorDocument 404 /page-unavailable/

<files ~ "\.tpl$">
order deny,allow
allow from none
deny from all

So I don't see why the page load at works fine while doesn't route through index.php like I want it to do.


share|improve this question

1 Answer 1

up vote 1 down vote accepted

You might need to set the AllowOverride All option to allow .htaccess files.

On a sidenote: Maybe you should think about moving the server logic into the server config.

share|improve this answer
Yes, that did the trick. Thank you. – Phil T Jul 2 '13 at 4:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.