Change index.html into start.html - html

Please I hope somebody can help me because i've been dealing with this problem already for about 2 weeks and I just can't figure out how to fix it.
I have added a new part to my website since I'm offering a totally new service. I put the new part under index2.html.
I have a new start/default page called start.html, on here they can choose to click on the service they are coming for, so will be either going to the old website part which is under index.html or they will go to the new part which is under index2.html.
To have people go directly to start.html I have put DirectoryIndex start.html in my htaccess file and this works fine. But when they choose which website part they want to go to and click on it they don't get the website index.html or index2.html but they get a message in the screen that their connection is not private and you will see a red https in front of the url link. I don't want it to be https, it just needs to be http.
Individually all the links work fine. So I don't understand why the message appears and what can I do about it?
I also did a link check on W3C, it said:
error Line: 87 www.example.com/index2.html
Status: 500 Can't connect to www.example.com:443
This is a server side problem. Check the URI.
error Line: 78 https://www.example.com/index.html
Status: 500 Can't connect to www.example.com:443
This is a server side problem. Check the URI.

Using index.html as the default file for /folder/,
ie. pointing the browser to /folder/ takes you to /folder/index.html
is such a widespread convention, you are almost definitely better off not messing with it.
My suggestion would be:
Rename /index.html to /old-part/index.html
Rename /index2.html to /new-part/index.html
Rename /start.html to /index.html

I concur with Rounin. A browser/website is designed to look for a file called index.html, index.php, index.xhtml, and so forth for the main page of the site depending on the type of website it is when it comes to your domain.
You need to do what Rounin suggested for your files to maintain a proper website without any headaches.

Related

HTML Fallback Page

Is there a way I can set a 'fallback' page?
For example, my technique for updating pages on my website is to firstly remove my original index.php and then replace it with a seperate index.html that reads "We'll be back soon!". This is to explain that all pages are down for maintenance (as I upload updated content).
This means anyone attempting to access my home page will be greeted with the maintenance message. The problem, though: if someone manually types in the URL of the page they are trying to access they would instead be resulted with a "Page not found" error.
Is there a way in which I can direct the user to index.html if they are attempting to visit a location that does exist - but just not right now (since I removed it to update content) ...if that makes any sense ;D
Assuming this is an Apache (or compatible) web server, place an .htaccess file in the document root directory (where your index.html usually goes) and put theses lines in it:
RewriteEngine on
RewriteRule ^ maintenance.html
This makes the web server respond to any and all requests with the maintenance.html file. Obviously, put your "under maintenance" web page there. You'd need to tweak that a bit if you wanted to serve images on that maintenance page, but this should get you going. See https://stackoverflow.com/a/20563773/476.

Hiding page names in the browser

When we launch a website, we usually see webpage name (menu.php or admin.aspx) but I would like to hide that name and show only virtual path or just website name. I don't want it for the first page because I did that with default.aspx but I want to implement it for the whole website.
Showing www.abcd.com/faq/ instead of www.abcd.com/faq/faq.html
Note: My code is not MVC code and server is Apache.
Use .htaccess to rewrite the URL. Millions of tutorials are out there for that ;)
What you are asking is achieved using (for xampp, wamp, lamp or any other apache powered webserver setup) htaccess rewriterules. The rules take the URL and break it into parts that can be modified or used as variables to feed other pages - whilst still keeping the URL you typed. Neat huh!
Showing www.abcd.com/faq/ instead of www.abcd.com/faq/faq.html
call the file placed into the folder faq simply index.html (not faq.html) and then www.abcd.com/faq/
will display the page without the filename. (Make sure, you have defined index.html as a valid Directory index.)
There are more options with using mod_rewrite etc - but since you seem to use a prety static directory based navigation layout, that would be the easiest way.

ipage: the default page does not direct to index.html

I just started developing web page, hosted by iPage.
I wanted to publish my own index.html instead of what was given.
But, when I actually enter the page, it directs to the previously changed page, which does not exist anymore.
I can access index.html, but only when I manually type in the address as epseattle.com/index.html.
How do I fix this?
I have tried fix on htaccess already.
Thanks in advance.
Please try this. Rename the original index.html which was available earlier in your web root to something like this index_1.html. And then try http://www.epseattle.com.
If the above not works, kindly post with your .htaccess file content.
In your .Htaccess file, try this:
DirectoryIndex index.html
Try switching off buffering on the iPage server (you can do this via their site). You will also need to do the same on the browser. Your changes should then be immediately visible. Remember, this is for development only and severely restricts performance of your server.

Do I need slashes before links?

When I code my website, on my local computer i can use
blablabla.
However, I also can see this type of thing on other places as
blablabla.
I am not sure what I will need when my site goes live. If I try to do this on my local computer, it doesn't understand it. My question is, if I post my site up like this, will it work?
Ok, if I have all of the files of my site in the root directory that the main index.html file is located in, will it work when it is being hosted?
If you do not use a slash, the link will point to index.html in the same folder as the page the link is on.
For example, if you have a link to index.html on the page www.example.com/page2.html then the link will take you to www.example.com/index.html. If you include a slash, it will do the same thing.
However, if the link is in a page in a subfolder, like www.example.com/projects/page2.html, then the first link will take you to www.example.com/projects/index.html while the second link will still take you to www.example.com/index.html.
The slash denotes the "web root."
Note that these are still considered "relative" links: they refer to a resource on the same server, regardless of the server's name. If your domain name changes or you upload it to another server, relative links will still work provided they have the same folder structure.

First website, only index.html page loads

I have made my first website and in the preview in Safari and Chrome from Dreamweaver it works fine. But after uploading my files with Filezilla to 000webhost and typing in the URL, only the index page loads, links to other pages on the site don't work, images are broken and the css isn't applied.
I'm think it is because I haven't named the files correctly in the code, but I have no idea what to call them in order to get it right.
The file you upload to is public_html. So I've tried http://www.webaddress/public_html/Pages/entertainment.html but it didn't change anything.
Thanks for any help!
Without code examples it's very difficult to answer this, but it's probably just that your URL format is incorrect.
For example, if you've got example.com/example/example.html and that page contains a CSS file with a location of /css/style.css, the web browser will look for example.com/css/style.css because the slash at the beginning of the URL tells it to go to the root.
In this case, your CSS file is probably actually in example.com/example/css/style.css. Remove the beginning slash so the location is css/style.css and the web browser will look for the file using the current page's location as it's starting point.