Sign up ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I want to internally point to /var/www/home.php and to be redirected to

Thus, I would like to fix the old to the new one But I always get infinite loop or other strange error no matter what.

share|improve this question

migrated from Feb 21 '11 at 21:40

This question came from our site for system and network administrators.

What rule are you trying, so we can tell you what's wrong with it. – DerfK Feb 20 '11 at 18:42

3 Answers 3

If you will redirect from to home.php then it would ofcourse go in to infinite loop. Rather try to include the home.php page in the index page of

share|improve this answer

If you just want home.php to be the directory index (as opposed to the usual index.php, etc), you don't need the overhead of mod_rewrite to do it:

DirectoryIndex home.php index.php index.html // and so on

It works in directory .htaccess files too, if you want to maintain a different default elsewhere. More details via mod_dir.

share|improve this answer

In your virtualhost definition for

DocumentRoot /var/www/

Then your rewrite rule:

RewriteRule ^/home.php$ /
share|improve this answer

Your Answer


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