+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: How can I open my site without having to append a /"foldername" to the URL

  1. #1
    jantom is offline x10Hosting Member jantom is an unknown quantity at this point
    Join Date
    Jan 2009
    Location
    Fayetteville, NC for now
    Posts
    14

    How can I open my site without having to append a /"foldername" to the URL

    My index.html file resides in a folder called main. When I want browse to my site I must append a /main at the end of the URL. Is there a way around this? I thank you in advance for help.
    jantom

  2. #2
    GrandeMike's Avatar
    GrandeMike is offline x10Hosting Member GrandeMike is an unknown quantity at this point
    Join Date
    Nov 2008
    Location
    Happy Valley, UT, USA
    Posts
    37

    Re: How can I open my site without having to append a /"foldername" to the URL

    You should be able to change which directory is used as the root directory in your cPanel. This is only if I remember correctly. You can with most hosts.

    Or you can use a meta redirect in a html file in your root directory to forward any visitor, or yourself, on to the sub-folder. I forget the proper meta syntax in the header. You could just google meta redirect and find it pretty easily.
    Last edited by GrandeMike; 03-20-2009 at 10:26 PM.
    The Grande-est of them all!

  3. #3
    leafypiggy's Avatar
    leafypiggy is offline Community Advocate leafypiggy is on a distinguished road
    Join Date
    Aug 2007
    Location
    Massachusetts
    Posts
    2,228

    Re: How can I open my site without having to append a /"foldername" to the URL

    Put this line in your .htaccess:

    DirectoryIndex /main/
    Neil Hanlon | x10Hosting Support Representative
    Neil[at]x10hosting.com
    █ I'm always happy to help. Just ask a question in Free Hosting
    Terms of Service IRC

  4. #4
    jantom is offline x10Hosting Member jantom is an unknown quantity at this point
    Join Date
    Jan 2009
    Location
    Fayetteville, NC for now
    Posts
    14

    Re: How can I open my site without having to append a /"foldername" to the URL

    Thx leafypiggy. I added the line of code to the bottom of the .htaccesss file (which i learned is a hidden file.) Now when i try to browse to my site i receive a "500 internal server error" with an additional "404 not found error while trying to use error document to handle request" error. What do i do now. thx.
    Last edited by jantom; 03-22-2009 at 10:38 AM.

  5. #5
    leafypiggy's Avatar
    leafypiggy is offline Community Advocate leafypiggy is on a distinguished road
    Join Date
    Aug 2007
    Location
    Massachusetts
    Posts
    2,228

    Re: How can I open my site without having to append a /"foldername" to the URL

    You will have to use an ftp client like FileZilla to see hidden (or dot files)

    Just use your cPanel info to connect to the server. If all else fails, create the file locally on your computer, and just use cPanel to upload it.
    Neil Hanlon | x10Hosting Support Representative
    Neil[at]x10hosting.com
    █ I'm always happy to help. Just ask a question in Free Hosting
    Terms of Service IRC

  6. #6
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: How can I open my site without having to append a /"foldername" to the URL

    I'd be very surprised if leafypiggy's approach worked. By setting DirectoryIndex in .htaccess for DOCUMENT_ROOT, anytime a user requested a URL that resolved to a directory, Apache would serve up DOCUMENT_ROOT/main/. If a user requested "/foo/bar/" zhe'd get "/main/". Moreover, Apache would no longer look for index.html when resolving a directory URI. I'm guessing this last fact is part of why you're getting to 500 error. All of the preceding doesn't apply when DirectoryIndex is set for a subfolder.

    You can use an external redirect, as GrandeMike suggests, or you can use rewrites (if you don't like that guide, Google will turn up plenty of others).

    I have to ask: why did you organize your site that way?

  7. #7
    jantom is offline x10Hosting Member jantom is an unknown quantity at this point
    Join Date
    Jan 2009
    Location
    Fayetteville, NC for now
    Posts
    14

    Re: How can I open my site without having to append a /"foldername" to the URL

    Thx for your reply. I'm not sure what u meant by why did i organize the site this way. The folder structure is what was presented to me when I logged into cpanel. I added the CSS folder to hold my style file(s) and the image folder to hold site image(s). The folder "main" was actualy named "jantom" which is my account name. I don't know why that is. I renamed it to "main". As of now, I totally fobar'd. I did try leaftpiggy suggestion and it didn't work and to make matters worse i believe i deleted a .htaccess file. How can i wipe the slate clean and start over? The site was in it's development infancy so i'm not losing anything except time as of now.

  8. #8
    garrettroyce's Avatar
    garrettroyce is offline Generally Helpful Member garrettroyce is a glorious beacon of lightgarrettroyce is a glorious beacon of light
    Join Date
    Apr 2008
    Location
    IL, USA
    Posts
    3,746

    Re: How can I open my site without having to append a /"foldername" to the URL

    I don't really understand what you did but, try doing a restore (cpanel->r1soft restore backups) to the earliest date. Hopefully this will put it back into a working state.
    Last edited by garrettroyce; 03-25-2009 at 12:09 PM.
    gjr.gr - coming soon: secrets of OCD coding from a self taught tinkerer

  9. #9
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: How can I open my site without having to append a /"foldername" to the URL

    Quote Originally Posted by jantom View Post
    Thx for your reply. I'm not sure what u meant by why did i organize the site this way.
    I was wondering why you had your entry page in /main/ rather than /. Site organization mostly involves what URLs access which pages (and thus where files are stored on disc), what content is on which page and how the pages link to each other; it was the first category I was referring to when I asked the question.

    Quote Originally Posted by jantom View Post
    The folder structure is what was presented to me when I logged into cpanel. I added the CSS folder to hold my style file(s) and the image folder to hold site image(s). The folder "main" was actualy named "jantom" which is my account name. I don't know why that is. I renamed it to "main".
    And all of these are under public_html? In that case, it'd probably be better to do away with /main and place index.html in DOCUMENT_ROOT. That's both a more standard and conceptually sound approach.

    Quote Originally Posted by jantom View Post
    As of now, I totally fobar'd. I did try leaftpiggy suggestion and it didn't work and to make matters worse i believe i deleted a .htaccess file. How can i wipe the slate clean and start over? The site was in it's development infancy so i'm not losing anything except time as of now.
    garrettroyce's suggestion should work for restoring your site. If not, I'll post a sample .htaccess that should work for you.
    Last edited by misson; 03-25-2009 at 09:06 PM.

  10. #10
    mastermike is offline x10Hosting Member mastermike is an unknown quantity at this point
    Join Date
    Oct 2007
    Posts
    21

    Re: How can I open my site without having to append a /"foldername" to the URL

    or another way would be to move main and all other folders you need out of the existing public_html folder. Then delete that folder and rename /main to public_html which would make main your root. then move any other folders back into public html. No need for redirects.

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Link exchange with Hamsn, General, Open source site
    By hamsn in forum Link Exchange
    Replies: 0
    Last Post: 01-14-2009, 09:25 AM
  2. Link exchange: Origami/Craft site
    By ichwar in forum Link Exchange
    Replies: 0
    Last Post: 01-06-2009, 05:57 PM
  3. My site wont open!!
    By alpha249 in forum Free Hosting
    Replies: 5
    Last Post: 06-10-2008, 03:01 PM
  4. Help! My site sometimes open and sometimes doesnt opens
    By ankur_desai in forum Free Hosting
    Replies: 4
    Last Post: 06-06-2008, 01:03 PM
  5. I can't open my site - Stoli
    By ivan_andrei_09 in forum Free Hosting
    Replies: 4
    Last Post: 02-27-2008, 09:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers