Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New Coder
    Join Date
    Apr 2006
    Posts
    64
    Thanks
    0
    Thanked 0 Times in 0 Posts

    basic html question

    im using default.html so ppl can access my website as www.xyz.com
    but if i want them to access a page as
    www.xyz.com/page

    instead of
    www.xyz.com/page/info.htm

    what do i do? also is there somethin better to use than "default.html" for seo purposes?

  • #2
    New Coder
    Join Date
    Apr 2006
    Posts
    64
    Thanks
    0
    Thanked 0 Times in 0 Posts

  • #3
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Quote Originally Posted by efhx View Post

    What are you trying to do???

    To access your site by typing the url only you would name it index.html and place it in the root directory.
    From that page you could link to info.html if you want.

    What do you get default.html from?
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #4
    New Coder
    Join Date
    Apr 2006
    Posts
    64
    Thanks
    0
    Thanked 0 Times in 0 Posts
    im trying to stop a page at a url like www.xyz.com/folder like if you goto http://joshminnich.com/ and click portfolio it stops at joshminnich.com/portfolio..or if u click any of the other links.. when i do that on my site it hsows the files in the folder as if it is browsed in windows explorer

  • #5
    Regular Coder
    Join Date
    Nov 2006
    Posts
    246
    Thanks
    13
    Thanked 26 Times in 24 Posts
    Oh, so basically you want to hide the folder content? When someone tries to view a directory alone (ex. www.xyz.com/folder), the server looks for a index file in that folder; if it finds it, that's what it shows, if not, if shows a list of the files/folders in that directory. Just make a file named index.html and upload it to the directory. If someone tries to access that directory alone, it'll go straight to index.html. Simple as that.

    Ex: http://www.codingforums.com leads to http://www.codingforums.com/forum.php
    Last edited by Majoracle; 01-13-2008 at 08:09 AM.

  • #6
    Regular Coder
    Join Date
    Jan 2007
    Posts
    137
    Thanks
    5
    Thanked 0 Times in 0 Posts
    u can either keep a blank index.html page on the folder so tht no one views the folder.. or in ur cpanel u can disable folder view... in case u wanna redirect ur a simple html redirect...


    Here's the code:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    <title>Your Page Title</title>
    <meta http-equiv="REFRESH" content="0;url=http://www.the-domain-you-want-to-redirect-to.com"></HEAD>
    <BODY>
    Optional page text here.
    </BODY>
    </HTML>

    Code Description:

    <meta http-equiv="REFRESH" content="0;url=http://www.the-domain-you-want-to-redirect-to.com"> is the part that actually does the redirecting.

    The number preceding the url (in this case zero) tells the browser the number of seconds to wait before redirecting to the new url.

    You could set this to 5 and add some optional text to your page - something like:

    "Please wait while we redirect you to our new site".

    That's it! Just copy the code, save it (i.e. save as index.html) and your html redirect will work perfectly.

  • #7
    Super Moderator sage45's Avatar
    Join Date
    May 2002
    Posts
    1,060
    Thanks
    0
    Thanked 13 Times in 13 Posts
    Now you may ask why the redirect works?

    Basically when a website is created there are a few pages that are automatically defined at the root/home/base level of the website as root pages... The root pages, or documents, are defined to the webserver as pages to look for when a website loads... By definition these webpages can be anything the administrator desires but a few standards have been implemented. The standards are index, default and iisstart [if dealing with a Microsoft IIS Server].

    If the webserver does not find these pages then the webserver displays the contents of the folder based upon the security rights of the internet user... The rights of the internet user are usually bound to an authenticated user on the server usually defined as an anonymous account... In most cases the anonymous account is given read only access to all folders available for a particular website...

    -saige-
    HTML & CSS Forum Moderator

    "If you don't know what you think you know, then what do you know."
    R.I.P. Derrick Thomas #58
    1/1/1967 - 2/8/2000

  • #8
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    It's possible to change it from index, though (and even change which file extension gets priority.)


  •  

    Posting Permissions

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