How to execute a HTML file on my homepage? - html

I just created a basic html file and want to upload that file to my website.
So what I've done is, went to cpanel->file manager->/htdocs and uploaded the file(sandy.html).
But the problem is it's not executing on my home page( i.e. sandeep.0fees.net). It's just showing the file that I uploaded.
I think you'll understand better when you see my website.
Where I'm going wrong? What should I do to make that file to run on sandeep.0fees.net instead of sandeep.0fees.net/sandy.html?

Rename your file to index.html
Or call it directly http://sandeep.0fees.net/sandy.html

Try renaming it index.html. There is a setting called a default document and that is the file that is loaded when you end the url without a filename.

If you want it to be the default landing page, call it index.html instead.

You can also add this line to the .htaccess file, in the public_html folder:
DirectoryIndex sandy.html index.php index.html
If it doesn't exist, create it! :)

Related

How to set a webpage as the automatic homepage

While uploading a website I made to a domain, I realized that simply putting in the address without any specific paths, the site didn't work. For example, typing in "example.com" leads to the path directory instead of the homepage which would be under something like "example.com/home". How can I set it so that when typing in "example.com" it leads to "example.com/home"? Thanks.
Hi,
Just make a file name .htaccess and put in it this code
DirectoryIndex homepage.html
Take care you can't make .htaccess file from windows explored
Because it unnamed try to write in notepad and save without name just extension
Finally put it in website root (in hompage.html folder).

How to add a web page directly onto domain?

Sorry if this isn't the appropriate place to ask this question, as it doesn't pertain directly to code, but I haven't found any help anywhere else.
So I've created a temporary landing page for my website that's just an .html file. I've uploaded it onto the host's public_html directory. In order to access that page I need to go to example.com/test.html. However, I'd like to be able to access that page by just going to example.com.
You can do this by adding this content to .htaccess file in public_html directory
RewriteEngine On
DirectoryIndex test.html
replace test.html with your file name
it's entry page, for whole entry pages, you should use naming index.html, rename your page to index.html

How to make my html launch right away, not in "Index Of" directory?[html]

I want my html file to launch right away when on start, but now it shows me this:
I use free webhosting, how do I make it main file, or root file that actually gets launched when visiting my website?
Try renaming the file erjan_sample.html to index.html.
Read up about the .htaccess file.
You can set your DirectoryIndex to any file you want.
Try renaming the file erjan_sample.html to index.html/Default.html
Rename your .html as "index.html"
Just change the name of your root site to index.html

HTML setting an HTML page on load

I've just got my website up and when I only type in the domain I get an Index of all the files that I've uploaded, but I want it to load my HTML page when it gets loaded as www.domain.com/domain.html instead I want it to be www.domain.com.
How do I do this? Do I have to contact my hosters or can I do this in the project?
As long as the web server doesn't use wacky configuration, you can just name the main file "index.html" and it will be the main access point to your domain.
Please keep index.html file in top level directory of application. If you do not have index.html file then add new file in top level directory and redirect it using onLoad function to your website home page.
All you have to do is to rename domain.html to index.html and it will be displayed automatically when the site loads.
That is the main page you wish to display when someone visits www.domain.com should be named index.html if it is an html page, if not you use the correct file extension.
A way to keep using domain.html as the main source file. Create an index.html file and add the following code in it.
<script>
setTimeout(function(){
window.location='domain.html';
}, 5000);
</script>

how to display first page in localhost?

I am using Xamp to create a website, I am having a folder named HTML which has a page called Cart.html, the folder HTML is found in htdocs and I want Cart.html to appear as soon as localhost is being input in the browser. That is when I input http:// localhost/, the Cart.html page should appear. I am unable to do, can u suggest me how to do it.
Simple HTACCESS rule:
Redirect 301 index.html Cart.html
Assuming they are in the same folder, otherwise replace with whatever needed
Rename the cart.html to index.html & put it in htdocs as 'htdocs/index.html'
You can create a .htaccess file with the following contents. The only problem here is that any sub folder will look for "Cart.html" as its default page
DirectoryIndex Cart.html
If you do not need the index.html file at all, I recommend deleting it and putting this DirectoryIndex instead
DirectoryIndex index.html Cart.html
This will cause all folders to look for "index.html" first and if it doesn't exist it will use "Cart.html"