how to display first page in localhost?

1.8k Views Asked by At

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.

3

There are 3 best solutions below

0
ggdx On BEST ANSWER

Simple HTACCESS rule:

Redirect 301 index.html Cart.html

Assuming they are in the same folder, otherwise replace with whatever needed

0
shabeer On

Rename the cart.html to index.html & put it in htdocs as 'htdocs/index.html'

0
thewheat On

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"