Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 www.mydomain.com.au/* to www.mydomain.com.au/index.html

here is my code

RewriteEngine On
RewriteBase /

RewriteRule ^(.*)$ http://www.mydomain.com.au/index.html [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

1 Answer 1

Try adding ...

RewriteCond %{REQUEST_URI} != http://www.mydomain.com.au/index.html

... before ...

RewriteRule ^(.*)$ http://www.mydomain.com.au/index.html [R=301,L]
share|improve this answer

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