Mobile app version of vmapp.org
Login or Join
Michele947

: Can you rewrite the root? Not sure how to word this one but will explain most I can. I am trying to make the following happen. Re-write this http://example.com To this http://example.com/home/

@Michele947

Posted in: #Apache #Htaccess #Url #UrlRewriting

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

I am trying to make the following happen.


Re-write this example.com To this 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.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Michele947

2 Comments

Sorted by latest first Latest Oldest Best

 

@Yeniel560

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

Redirect / example.com/home/

If you want to rewrite / as /name

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

10% popularity Vote Up Vote Down


 

@Pope3001725

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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme