How do I make my main page a CSS file.

planetks

New Member
Messages
1
Reaction score
0
Points
0
I have been making a CSS homepage, I uploaded it to Public_HTML in the online FTP program.
I checked it and got Index of/ then my files in the folder.
How do I prevent this?
 

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
A CSS file is not a web page, so web servers like Apache and Lightspeed won't serve them by default. Your "home page"—the page that is automatically served when someone visits your domain—must be either an HTML file or a PHP file (on these servers) named "index"; so either index.html or index.php. (On other server types, the page may be named "default", like default.aspx in an ASP.NET environment, for instance. Or the server may allow you to designate a default opening page for the application and a default application for the server, as Lotus Domino does.)

If you don't provide an index page (either index.html or index.php), then the server will provide the default index for the directory. (Note that unlike Apache, Lightspeed does not auto-index by default, since it's really bad to do that from a security perspective.)

You can, of course, do some .htaccess jiggery-pokery to point the user to your CSS file, but you should think of that as a strict no-no. Again, a CSS file is not a web page, and people who go to your domain should at least get a bit of information, like a list of the available files and APIs/services on your domain. (Note that a site that provides nothing but files and APIs is probably in violation of the Terms and Services for x10Hosting's Free Hosting service—part of the deal is that you need to have an operating web site.)
 
Top