To hide the extension shown in the address bar, you have two options.

  1. 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.
  2. 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 Overflow
🌐
GitHub
github.com › scottjehl › Hide-Address-Bar › blob › master › demo.html
Hide-Address-Bar/demo.html at master · scottjehl/Hide-Address-Bar
<html> <head> <meta charset="utf-8"> · <title>Test page</title><title>Cross-device Address Bar Hide - Example 1</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script src="hide-address-bar.js"></script> <style> /* DEMO ONLY for this short page - remove in live code */ body { min-height: 480px; } </style> </head> <body> <p>The script on this page should hide the address bar on iOS and Android.</p> </body> </html>
Author   scottjehl
Discussions

html - How to hide url in Address bar - Stack Overflow
Find centralized, trusted content ... you use most. Learn more about Collectives ... Connect and share knowledge within a single location that is structured and easy to search. Learn more about Teams ... I want to keep same url for all the pages of my site. ex: if my site is www.abc.com & xyz.html is a ... More on stackoverflow.com
🌐 stackoverflow.com
javascript - Hiding the address bar of a browser (popup)
Is there any solution to hide the entire address bar by ignoring above MSDN article? I am testing in IE and Google Chrome. ... Save this answer. Show activity on this post. ... Microsoft's documentation describing the behaviour of their browser is correct. ... No. If you could hide it, then you could use HTML... More on stackoverflow.com
🌐 stackoverflow.com
Hide Current Page URL in Address Bar - PHP - SitePoint Forums | Web Development & Design Community
Hi, I would like to add what I call a small security feature to my website. I currently have similar URL’s to most sites on the net - i.e. http://www.mywebsite.com/index.php http://www.mywebsite.com/company/about.php … etc. etc. I want to hide the “index.php” and “about.php” part ... More on sitepoint.com
🌐 sitepoint.com
0
May 12, 2004
How to hide url in Address bar
Find answers to How to hide url in Address bar from the expert community at Experts Exchange More on experts-exchange.com
🌐 experts-exchange.com
November 10, 2010
🌐
PrintMyFonts
askingbox.com › question › html-hide-url-from-browser-address-bar
HTML: Hide URL from Browser Address Bar
Instead, the whole time, only the domain name should be displayed. ... One possibility is to use Frames for your website. The result would be that only the starting page, that is your domain name, would be displayed in the browser. ... <!DOCTYPE html> <html> <head> <title>Window Title</title> ...
🌐
Stack Overflow
stackoverflow.com › questions › 32092726 › how-to-hide-url-in-address-bar
html - How to hide url in Address bar - Stack Overflow
I want to keep same url for all the pages of my site. ex: if my site is www.abc.com & xyz.html is a page. I want to display www.abc.com or www.abc.com/xyz instead of www.abc.com/xyz.htm Please
🌐
Webmaster World
webmasterworld.com › html › 11927.htm
Hiding the URL in address bar? - HTML forum at WebmasterWorld - WebmasterWorld
As moltar has said, you can use a 100% frame to mask your URL in the address bar, but it is a very bad idea for several reasons.
🌐
Openjs
openjs.com › articles › ajax › target_url_hiding.php
Hide the Target URL of a Link in Status Bar - OpenJS
Simple and easy method - but it ... disable this option. In Firefox, you can find that option at Tools -> Preferences -> Content -> Enable Javascript(click on the 'Advanced' Button) -> Change status bar text....
Find elsewhere
🌐
SitePoint
sitepoint.com › php
Hide Current Page URL in Address Bar - PHP - SitePoint Forums | Web Development & Design Community
May 12, 2004 - You can use .htaccess to call any page.php so it will show up as “page” and they will think it’s a folder. You can also have .htaccess force index.php to open without using index.php. Just yoursite.com/ will open up. I have the code here: DirectoryIndex index.html filename.html index.cgi index.pl default.htm index.php index.shtml index.htm filename.php
🌐
Quora
quora.com › I-wanted-to-display-my-web-app-but-want-to-hide-the-url-part-to-make-it-look-like-an-app-Is-it-possible-to-run-a-web-application-on-the-screen-by-hiding-the-url-bar
I wanted to display my web app but want to hide the url part to make it look like an app. Is it possible to run a web application on the screen by hiding the url bar? - Quora
... The I.T and Code Guy at Icoserv (2015–present) · Author has 32.9K answers and 28.8M answer views · 2y · If you want it into a web browser there's no way to hide the address bar, however if you convert it into a pwa it will only use ...
🌐
WebSite X5
helpcenter.websitex5.com › en › post › 252519
WebSite X5 Help Center - Hide url in address bar?
August 10, 2022 - There is no possibility in the X5 to "remove" the URL from browsers URL-sddress bar. ... Posted on the 08/10/2022 18:47:41 from John S. ... John, my previous reply seems to have vanished into the ether! So here we go again ... The solution in the link is not suitable. I have digital products (e-cards) that offers the buyer the opportunity to view another browser-viewable digital product. I do not want the second product to be identifiable in any web browser, hence the wish to obscure/hide the url.
🌐
Experts Exchange
experts-exchange.com › questions › 27260308 › How-to-hide-url-in-Address-bar.html
Solved: How to hide url in Address bar | Experts Exchange
November 10, 2010 - <?php if (isset($_GET['id'])) { $id = $_GET['id']; switch ($id) { case '123': header('Location: http://www.abc.com/news-123.html'); case etc... } } ... Signing up is free and takes 30 seconds. No credit card required. ... You can use IFRAME to do this.
🌐
Cloudzy
cloudzy.com › home › technology › what is domain masking? why should one hide url?
What Is Domain Masking? Why Should One Hide URL?
February 23, 2025 - The frame essentially acts as a “window” within the browser, displaying the content from the target website while keeping the original URL intact. There are several reasons why someone might want to hide their URL using domain forwarding:
🌐
Coderanch
coderanch.com › t › 118289 › languages › hide-address-bar
How can i hide the address bar? (HTML Pages with CSS and JavaScript forum at Coderanch)
July 20, 2006 - Nothing like a 4 year old post being risen from the dead. With modern day browsers it is impossible because new security practices will not allow the address bar to be hidden. It will be in a read-only type of state so the user can see where the page is located.
🌐
Coderanch
coderanch.com › t › 650505 › languages › Javascript-Hide-URL-Path-Address
Javascript - Hide URL Path in Address Bar (HTML Pages with CSS and JavaScript forum at Coderanch)
The requirement is: During web page navigation, the content of Address Bar should be limited to the application name. e.g. http://localhost:8080/MyApp/. It should not display complete path of the page opened currently. i.e. http://localhost:8080/MyApp/pages/contactus.html. This should be done using JavaScript only, or if possible, in JQuery too. Looking for suggestions from you. TIA. ... I am not sure whether URL rewriting can be handled at client side, but as you are using apache tomcat as your container, UrlRewriteFilter can be used for this.
🌐
PHP Freaks
forums.phpfreaks.com › client side › html help
Hide the address in the address bar - HTML Help - PHP Freaks
October 9, 2009 - Hi all, Is it possible to hide the address in the address bar of the browser or even better, hide the address bar? Please see this thread... This is where the problem started... http://www.phpfreaks.com/forums/index.php/topic,271673.0.html
🌐
Reddit
reddit.com › r/learnjavascript › how to hide .html in browser url
r/learnjavascript on Reddit: how to hide .html in browser url
April 25, 2023 -

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

Top answer
1 of 5
22
If you're just opening the .html files in your browser: the short answer is that you can't. Once you upload your site to a server, though, then there'll be a way to configure that server to effectively hide the file extensions - but it will change based on which server is being used. For example, if it's an apache server, then you'll want to look into .htaccess files . How a lot of websites are built these days, though, is as what's called a "Single Page Application" (SPA) , where you only have an index.html, and its DOM contents are added / removed as needed - when you do this it's also good form to add / remove states to the history API , so that your users can use the back / forwards buttons to navigate, but it's not required to make a SPA if you're just starting out and learning the ropes. If you're looking to go full vanilla, then I'd advise you to look into Web Components - it sounds like you've been having trouble dissecting the documentation, however, so here's a codepen I made a while back, which is basically a heavily-commented crash-course in web components and all of its features . The idea being that you would create multiple custom elements like , , etc with document.createElement() , and then just add / remove them from the page with appendChild() and remove() . Hope that all makes sense! Give's a poke if you have any follow-up questions!
2 of 5
2
It depends how you are deploying your site. How the page is served isn't included in your html file anywhere. Many static hosts will do this for you. Cloudflare pages (imo a pretty good host for beginners) does it by default: https://developers.cloudflare.com/pages/platform/serving-pages/#route-matching I think GH pages also does the same. Netlify has an option for "pretty urls" that should do the same. Sometimes it helps to move things into their own folder and name the file index.html
🌐
HTML5 Game Devs
html5gamedevs.com › frameworks › phaser 2
Hide address bar in browser
December 17, 2014 - Hi, I am trying to hide my address bar in browser, without success, maybe can give me a little help with this? This is my code in the create function in Boot.js. Thanks!this.input.maxPointers = 1;this.input.addPointer();this.stage.disableVisibilityChange = false;this.scale.scaleMode = Phaser.Scal...
🌐
Mozilla Support
support.mozilla.org › en-US › questions › 1385866
How to hide the full URL from address bar? - Mozilla Support
August 11, 2022 - JavaScript is disabled in your browser · Please enable JavaScript to proceed · A required part of this site couldn’t load. This may be due to a browser extension, network issues, or browser settings. Please check your connection, disable any ad blockers, or try using a different browser