some super basic questions

Status
Not open for further replies.

kimzim

New Member
Messages
1
Reaction score
0
Points
1
i'm super new to html and css. so, very new to navigating hosting too. i am taking my first html/css class.

1. will x10hosting only recognize my html file if it is named index.html? it doesn't seem to display my pages unless i name the html file "index.html"

2. am i only allowed the top level page? say my page is http://zimtravels.x10host.com/c12/ and i want to create a page http://zimtravels.x10host.com/c12/index? can i do that?

thanks!
 

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
The index page is the page that will be displayed automatically without having to ask for the file by name. Yes, it does need to be named index.html, index.htm, or index.php, and you can only have one of them per directory - otherwise the server wouldn't know which one to serve. You can have other files if you want, but you'll need to ask for them by name, since they won't open automatically.

If you have a file named index.html in a directory named c12 in your public_html directory, it will open with the URL http://zimtravels.x10host.com/c12/ or http://zimtravels.x10host.com/c12/index.html. So no file name, or the full file name including the .html extension. There's nothing stopping you from putting a directory named index inside your c12 directory, except (perhaps) a strong desire to avoid user confusion if they ever notice that "index" and "index.html" go to two different places.

You can avoid some of that by using a .htaccess file to mangae URL rewriting for you. Basically, that allows difference between what the user sees in their nav/address bar and the actual file names and folder structure on the server. There's a pretty good tutorial here that will give you enough information to tackle the Apache mod_rewrite documentation later, if you desire. Warning: there are regular expressions involved, and those can get very tricky very quickly if you try to do too much all in one go. (You can make it work, but it's hard to figure out why it works later, or what needs to be changed where if a change is needed.) Keep them simple, and they'll be nice (ish) to you.
 
Status
Not open for further replies.
Top