2

Not sure how to word this one but will explain most I can.

I am trying to make the following happen.

  1. Re-write this http://example.com

  2. To this http://example.com/home/

Is it possible ?

update

Simone Carletti - the method you posted did not work, have you had this work ? Also would it visually change in the browser URL bar to say /home/

John Conde ♦ - this did not work either I was getting a warning from Firefox saying it would never complete so it did not load the page.

1
  • @danlefree He tagged the question as htaccess, thus we can assume he's using Apache. Commented Oct 7, 2011 at 0:08

2 Answers 2

4

If you want to redirect A to B, simply place the following directive in your .htaccess file:

Redirect / http://example.com/home/

If you want to rewrite / as /name

RewriteEngine On
RewriteRule ^/$ /home/ [L]
2

I'm not an expert at this so this may be wrong. If so, let me know so I can either correct it or delete it.

RewriteEngine on
RewriteRule ^$ /home/[L,R=301]

edit

This stackoverflow questions seems to ask the same question. Check it out and see if you find a solution there. If so, let us know so we can post it here for future reference.

1
  • This did not seem to work, but thanks.
    – Mr Obvious
    Commented Oct 6, 2011 at 16:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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