How can I force Chrome to open index.html file while browsing a local directory? - html

I am trying to implement an internal website on my company's shared hard drive.
Everything is going well except that I would like Chrome to open index.html file by default on root folder, exactly how it would do it on a remote web server. Any ideas, folks ?
What we do have as for now :

You have to run a webserver. By default, chrome will not serve any file, you have to open them on chrome properly.
So, since you're using WordPress, I suggest you to run xampp, or anything similar. To run on internal local network you have to configure windows to allow incoming connections from your machine IP address

Related

How to test HTML/CSS files from PC on mobile device

Here's the situation:
I have a folder on my PC containing a single HTML file, a CSS file, and an images folder. I've been testing it through the browser on my PC, but I wanted to run the same files off my Android to test on mobile. I zipped the entire folder, emailed it to myself, and then downloaded it and unzipped it on my Android. When I click on the HTML file I can open the page on the mobile browser, but it appears that the CSS file is not loading at all, despite all of the files still being in the same folder together on my phone. Is there an obvious problem I'm missing?
If the issue is coming from your phone and not the file, try to upload it on a free web host, like byethost, and open it directly trought internet.
You'll need to get your files into a web server.
If you don't have an external site you can use, you can still do it with a local web server. Depending on your OS, options for a local web server include IIS, Apache (via XAMPP on Windows), or even debug mode from an IDE like Visual Studio.
Next, get a tunnelling service like ngrok or localtunnel. When you run it, it will give you a temporary external website address that redirects to your local web server. You can then use your mobile device to test.

Website stuck caching old files

I am working on a website, but whenever I upload a new file to my hosting provider (BlueHost), I cannot get the new version of the file to load in any browser or any PC that I have. This happens with both images and html files. I have tried loading the updated page on multiple computers on my network, but they all show the old version of the files. The new files will load on my phone, but only on 3g. I tried connecting through an Open VPN connection and this did not fix the issue, I also have cleared the cache in chrome on the computer. Any idea what could be going on?
Check your .htaccess file. It might have server caching set up.

How to open a HTML file on remote machine on local browser

I have written a simple HTML file on an EC2 instance. I want to check if it functions as desired. Is there a way I can open it on my local browser for testing?
EDIT: The output depends on some configurations which are present only on the remote machine!
You will need to install and start apache, placing the HTML vile in the www directory on the sever. Then open port 80 in your ec2 security group, but specify this rule to only be for the public IP of your home machine.
If its a HTML file you can open it directly from your desktop but if is a php file you need local server such as Xampp or wamp. If you want to edit it you can have a code editor such as notepad++ ect.. Hope this helps
If I understand you correctly. .. just open the file. It will run in your browser. It is just text. It is your browser that runs it.

Looking for a (httpd like) way/server to access static files (html/images etc) from my windows pc using http

I have a static html project which contains some files I want to have access to using my cell phones or laptop's internet browser.
The concept is I have a folder in my pc which contains the files.
I would hit my computer's IP through the web browser of my laptop
(like http://192.168.1.5/myProject/index.html)
and then a server (like apache httpd works for redirecting to servers) would return me the wanted file.
NOTES:
-It should be EASY and FAST to install and Configure.
Any suggestions? Most acceptable answers are for Windows and then I accept for mac!
Have you tried xampp for an apache server? There is a portable app version as well.
Also iisexpress is a nice standalone version of IIS that runs under current user profile. Not sure if there are any limitations w the bindings tho.

Access of the data by the server on the server machine

My question is I know that a server application can access the data stored at server but cannot access teh data stored at client machine as this is a security issue and Browsers not allow this. But in case of localHost (when my local pc is acting as a server) I should be able to access the files from my PC(the local PC on which the application is running). But that is not happening.
Why i m not able to access a simple image file form my local C:\ drive by localhost. The URL i used was file:///c:/image.png but if i store this image any where under home directory of tomcat i m able to access it. WHY ??
I m using it as <'img src="file:///c:/image.png>
Thanks for any considerations..
The problem is with this part:
The URL i used was file:///c:/image.png but if i store this image any
where under home directory of tomcat i m able to access it.
If you want to access the file through Tomcat after placing it in Tomcat's document-root, then the URL to use (assuming you haven't changed the default port setting) is:
http://localhost:8080/image.png
Content hosted by the web-server needs to be accessed through the web-server. A file:// URL bypasses any sort of server, and basically directs the browser to look directly in the local filesystem. So it should also work if you were to do:
file:///C:/path/to/tomcat/home/image.png
But in that case you are not going through Tomcat. You're just pointing the browser at the tomcat folder in your local filesystem.
Edit: I don't think many browsers will not allow file:// urls in tags in hosted documents. Doing so could cause the appearance of a security hole, as if you could guess the name of an image file on someone's local filesystem you could then post a webpage that made it appear as if your server had somehow grabbed their personal image file.