Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am new to htaccess. so when i want to do a url redirect using htacces, i always get a redirect loop, and don't know how to fix it. I have been searching on the web but coundn't find a solution for me. please help on this

what i want to do is to redirect all the subpages under root(/*) to index.html under root (/index.html)

i need to redirect* to

here is my code

RewriteEngine On
RewriteBase /

RewriteRule ^(.*)$ [R=301,L]

please help on how to fix this thanks very much !!

share|improve this question

marked as duplicate by Jenny D, Ward, Falcon Momot, mdpc, MadHatter Sep 10 '13 at 19:41

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

please use better output formatting for the .htacess code snippet – inetplumber Sep 9 '13 at 2:52
Can you provide either the access log or activity capture from the client browser, showing what redirects are occurring in the loop? – Shane Madden Sep 9 '13 at 4:49

Try adding ...

RewriteCond %{REQUEST_URI} !=

... before ...

RewriteRule ^(.*)$ [R=301,L]
share|improve this answer

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