Reputation: 569
Is there a way for an HTML file or other format that when clicked, will open the default browser and navigate to a specified http://
web page, NOT a local file://
?
Upvotes: 3
Views: 13681
Reputation: 17
Do you mean if there is a way to set your HTML files to a default web browser, so that when you double-click them, they'll open up in....lets say for example (chrome.exe, firefox, opera, etc etc...)? If so, I recommend you right click the HTML file and navigate to "open with", and choose the web browsing program you want to use.
If you really want to take the easy route. Download notepand++ text editor(notepad-plus-plus.org).
Here's a picture of how to run HTML file in notepad++ in the browser:
https://i.sstatic.net/Yuynt.png
Upvotes: 0
Reputation: 2163
At least for an HTML file, no. When you click on an HTML file, your computer will open it in your default web browser, and the URL at the top will will be a file://
as that's the location of your file. You can, however, include some JavaScript to redirect people.
<script>window.location = "https://www.google.com";</script>
That way people will open the local file, but they will be automatically redirected to Google.
Upvotes: 1
Reputation: 39248
<script>
location.href = 'www.someUrl.com'
</script>
Just create an html file that contains something like the above. When you click it you will be redirected.
Upvotes: 7
Reputation: 464
Yes, a shortcut. Create shotcut and type your browser application url and add link. Example like this:
"C:\Program Files\Firefox\firefox.exe" "http://www.google.com"
Upvotes: 1