I have enabled mod_rewrite on my server and confirmed it using phpinfo() and it shows as enabled.

I have the following in my httpd.conf file:


RewriteEngine on
RewriteRule ^/test$ /index.php

I've tried the rewrite rule on another server and it works as expected. No errors are thrown to my apache error log and it restarts cleanly. When I try the page it 404s and doesn't load index.php

I'm sure this must be a simple problem, but I am at a loss on how to figure it out. Any help is appreciated.

  • Still working on this. In case it is useful, I'm using Ubuntu 12.04 and apache 2.2.22
    – user611478
    Jul 3, 2013 at 13:48
  • 1
    Have you enabled reqritelog? Jul 3, 2013 at 13:55
  • Hi, yes we have and no error messages came through.
    – user611478
    Jul 3, 2013 at 14:00
  • What is your LogLevel set to? Default is warn, increase it to debug if you haven't already, restart Apache and try again, and update your post with what you see in the logs. If you still don't see useful information, enable RewriteLog as Krist van Besien suggested, more here: httpd.apache.org/docs/2.0/mod/mod_rewrite.html#rewritelog
    – KM.
    Jul 3, 2013 at 14:04
  • Hi, I have set LogLevel to debug, but nothing of relevance shows with respect to mod_rewrite. I also have RewriteLog enabled, but nothing is written to that log.
    – user611478
    Jul 3, 2013 at 14:24

1 Answer 1


check in web directory the hidden file called .htaccess . If exist Open the file and check the settings. 404 page is for page do not exist. Check the apache error log also

  • Hi, there is no .htaccess file. Apache is also showing no errors.
    – user611478
    Jul 3, 2013 at 9:04
  • a2enmod rewrite ,run this command once again and restart the apache and after restart check the logs, I expect you have defined apache error log in conf file Jul 4, 2013 at 3:07
  • Hi, I've run that a few times to no avail. In the end I have worked around the problem by doing it via .htaccess file which worked first time. I was never able to solve the original problem.
    – user611478
    Jul 4, 2013 at 15:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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