To hide the extension shown in the address bar, you have two options.
- If you control the server, you can define rules that rewrite the URL based on the one the user is trying to get to. In PHP you can use the .htaccess file to define mod_rewrite rules. For similar features to .htaccess you can install the application request routing module in IIS 7 and above. In IIS (Windows) you can set up default pages that come up when users go to particular sites.
- You can also make that all of your pages are accessed through the same page using AJAX, or put all the content on the same page and hide it using CSS and display it with CSS and/or JS.
This is a very high level answer, because the specifics vary greatly from situation to situation.
Answer from Snowburnt on Stack OverflowTo hide the extension shown in the address bar, you have two options.
- If you control the server, you can define rules that rewrite the URL based on the one the user is trying to get to. In PHP you can use the .htaccess file to define mod_rewrite rules. For similar features to .htaccess you can install the application request routing module in IIS 7 and above. In IIS (Windows) you can set up default pages that come up when users go to particular sites.
- You can also make that all of your pages are accessed through the same page using AJAX, or put all the content on the same page and hide it using CSS and display it with CSS and/or JS.
This is a very high level answer, because the specifics vary greatly from situation to situation.
Yes, you can do by javascript.
<script>
window.history.replaceState('','','/');
</script>
html - How to hide url in Address bar - Stack Overflow
javascript - Hiding the address bar of a browser (popup)
Hide Current Page URL in Address Bar - PHP - SitePoint Forums | Web Development & Design Community
How to hide url in Address bar
Videos
What is the truth?
Microsoft's documentation describing the behaviour of their browser is correct.
Is there any solution to hide the addressbar?
No. If you could hide it, then you could use HTML/CSS to make something that looked like a common address bar. You could then put a different address in it. You could then trick people into thinking they were on a different site and entering their password for it.
It is impossible to conceal the user's location from them because it is essential for security that they know what their location is.
This is no longer possible in modern browsers due to security restrictions.
Official(-ish) Sources:
Firefox
In Firefox 3, dom.disable_window_open_feature.location now defaults to true, forcing the presence of the Location Bar much like in IE7. See bug 337344 for more information.
Internet Explorer 7 and later
In Internet Explorer 6, location specifies whether to display the Address Bar.
(Implying the behaviour ends with IE6)
Chrome/Chromium
Those toolbar hiding parameters are ignored in Chrome. You will also notice that modern browsers are moving towards not hiding it as security / anti phishing measures. Also see https://bugzilla.mozilla.org/show_bug.cgi?id=337344
this should work.
Put this in a file called .htaccess and put it in your root directory. Only works on a apache webserver though and not locally.
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule .* $0.html
How are you writing your "Home" link?
Having said that, don't include the /index.html portion in your anchor tag.
Also, if you wanted to show the main site URL www.mysite.com for every local link in your site no matter the webpage your at (photo gallery, about us, etc.), wrap your whole website in a iframe that's the entire space of the viewport which will prevent the Address Bar from changing.
Reference: jsFiddle or is it???
The above jsFiddle site shows this simple iframe method described. Notice that the Address Bar is always at the same place since the iframe is receiving all the navigation interaction.
View that jsFiddle without the /show/ as seen in the Address Bar to access the Edit Page.
how to hide .html in browser url. using javascript.
I only use html, css, and js
hide in these files:
blog.html
contact.html
about.html
I was seeing that they used routes with javascript, but it didn't work for me
Thank you
It is not possible in modern browsers since concealing the address of a page aids phishing attacks.
Is there any solution to hide the addressbar?
No. If you could hide it, then you could use HTML/CSS to make something that looked like a common address bar. You could then put a different address in it. You could then trick people into thinking they were on a different site and entering their password for it.
It is impossible to conceal the user's location from them because it is essential for security that they know what their location is.