TwelvestoneBack End

.htaccess 301 rewrite


Sign in

  • Waiting for Godot ( 730 k posts )
    Just conversation.
  • Thunder Dome ( 23 k posts )
    Photoshop Tennis and Collabs.
  • Photography ( 5.1 k posts )
    For all you shutterbugs, sh...
  • Flash ( 18 k posts )
    ActionScripting to tweens, ...
  • Front End ( 5.9 k posts )
    general front end design an...
  • Back End ( 9.7 k posts )
    serverside scripting, progr...
  • Projects and Theory ( 12 k posts )
    This forum is for discussio...
  • FAQ ( 269 posts )
    All those nagging questions...
  • Design ( 17 k posts )
    graphics & all aspects of g...
  • Purgatory ( 3.6 k posts )
    12stone Jail, feel free to ...
Technomancer
 
2009-08-20

What do I need to place in the .htaccess file to redirect every page in a site to the index page?

If I try something like:

RewriteRule .*$ /index.html [L,R=301]

and I visit the home page will the server just drop into an infinite loop of redirecting itself to the index.html?

ShEx
 
2009-08-20

Maybe something like this to stop the loop:

RewriteCond %{REQUEST_FILENAME} !index.html$ RewriteRule .*$ /index.html [L,R=301]

Sorry, you must be a member to post to a conversation. Either log in or sign up to get involved.
TwelvestoneBack End

.htaccess 301 rewrite