+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11

Thread: Change Root Folder

  1. #1
    Join Date
    Aug 2007
    Posts
    8

    Default Change Root Folder

    How can I change my primary Domain root folder from /public_html to /public_html/my_folder ?

    The website I wish to display is in my_folder but www.mydomain.com shows the default webpage from the /public_html folder.

  2. #2
    Join Date
    Feb 2006
    Location
    Somewhere where I don't know where I am
    Posts
    2,155

    Default

    Edit and add this to your .htaccess file

    Code:
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^(www.)?DOMAINNAME.com$
    RewriteCond %{REQUEST_URI} !^/my_folder/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /my_folder/$1
    RewriteCond %{HTTP_HOST} ^(www.)?DOMAINNAME.com$
    RewriteRule ^(/)?$ my_folder/index.php [L]
    Sign Up Now!
    Unlimited Storage, Unlimited Transfer, Host Unlimited domain names, 1 Free Domain Name
    BlueHost Features | BlueHost Help Desk | Become a BlueHost Affiliate | BlueHost CEO Blog
    (888) 401-4678 | Create a support ticket

  3. #3
    Join Date
    Aug 2007
    Posts
    8

    Default

    [QUOTE=areidmtm;38833]Edit and add this to your .htaccess file

    Where is my .htaccess file?

  4. #4
    Join Date
    Feb 2007
    Location
    http://www.bluehostreview.org
    Posts
    1,104

    Default

    [QUOTE=yachthub;38846]
    Quote Originally Posted by areidmtm View Post
    Edit and add this to your .htaccess file

    Where is my .htaccess file?
    the .htaccess file will be at the /public_html
    if you not have it, just use windows to create the file .htaccess. And paste in the code above.
    Charles Gan
    Bluehost Reviews : Bluehost reviews hosted at bluehost
    Bluehost Speed Test : bluehost hosting speed Test!
    Bluehost Uptime : Bluehost uptime monthly reports

  5. #5
    Join Date
    Mar 2006
    Posts
    462

    Default

    [QUOTE=yachthub;38846]
    Quote Originally Posted by areidmtm View Post
    Edit and add this to your .htaccess file

    Where is my .htaccess file?
    Open a text editor (like Wordpad or one of the thousand free alternative ones like HTML Kit ) and paste areidmtm's code in there. Save the file as .htaccess and upload it to your root directory/public html.
    Cheap web hosting review directory listing a
    Hostmonster review and a Bluehost review - CPU, support, plans, speed test, uptime

  6. #6
    Join Date
    Aug 2007
    Posts
    8

    Default

    Thanks for your help guys, got it!!

    When I uploaded .htaccess I couldn't see it, I guess the "." means hidden?
    I uploaded without the dot and then renamed it which seems to have worked.

    How do I see .htaccess if I want to edit it?, or do I just upload another one?

  7. #7
    Join Date
    Jul 2007
    Posts
    17

    Default

    Quote Originally Posted by yachthub View Post
    Thanks for your help guys, got it!!

    When I uploaded .htaccess I couldn't see it, I guess the "." means hidden?
    I uploaded without the dot and then renamed it which seems to have worked.

    How do I see .htaccess if I want to edit it?, or do I just upload another one?
    In which application can't you see it? Perhaps there's an option to make such files visible?

    If you keep a copy of your web-site on your PC it doesn't actually matter whether you can see your .htaccess files on the server, just upload a revised copy. Alternatively you can edit your .htaccess files on the server in CPanel's File Manager.

  8. #8
    Join Date
    Aug 2007
    Posts
    8

    Default

    I was using legacy file manager as File Manager seemed to be causing problems on my machine.

    Using File Manager with the Show Hidden Files option selected I can see it.

    Thanks.

  9. #9
    Join Date
    Jun 2009
    Posts
    1

    Default Thank you!!!

    I've been searching for days! This solution worked perfectly, I had to register to post and you have no idea how much time you've saved me Areidmtm, thanks!!

  10. #10

    Unhappy A Simular Problem...

    Hi All I have a simula problem.

    I often edit/modify sites in a folder on my own server before uploading things onto other domains.

    I have been experiencing problems as lots of the sites have links to css files using root directory links...

    e.g.
    <link href="/css/main.css" rel="stylesheet" type="text/css" />

    But the files are in the subfolder
    /websites/wings/

    And that links points at the root
    /

    I cant change the links as the sites have to be put back on the server at a later date.

    Is their a way i can use .htaccess to change the root location for the files?

    So that /websites/wings/index.php root links will be pulled from /websites/wings/...

    Thanks Matt

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts