How to hide the url path in html

When I upload my website files to my server and goto my website, i see the index.html at the url bar of the browser. How can I hide this?

http://bakpinar.com/about/about-us.html

I would like it to look like in this example;

http://www.royaltyline.com

as you can see, you only see the website address in the url bar of the browser. And when you click to another page, it doesnt show the .php, .asp or .html extension, just shows the folder name.

How to hide the url path in html

peterh

11.1k15 gold badges80 silver badges102 bronze badges

asked Oct 26, 2013 at 11:59

3

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.

answered Oct 26, 2013 at 12:03

How to hide the url path in html

SnowburntSnowburnt

6,2237 gold badges28 silver badges41 bronze badges

0

An easy way to do this, in case someone is still looking, is to use a full-screen iFrame. No matter where on the page your users are, they will always only see the main url. This used to be very popular back in the day, but it was a terrible practise in terms of usability.

the stuff

Write that into the index.html file at http://www.royaltyline.com

How to hide the url path in html

answered Nov 21, 2015 at 8:26

SebastyneSebastyne

711 silver badge1 bronze badge

Yes, you can do by javascript.


answered Aug 13, 2019 at 5:46

How to hide the url path in html

It's not actually a folder name. It's rewritten URL.

To do such things you should redirect all requests to one file (index.php for example), then parse URL and basing on its parts, show particular file.

To redirect everything to index.php, use mod_rewrite module of Apache + .htaccess file.

To choose specific file you can implement one of several approaches. It's usually called routing in design patterns.

Completely other approach would be to use AJAX for reloading content. But it's not the way it was made on the website you gave as example.

In general there is a lot of information about routing urls in PHP on the web. Just do some research.

answered Oct 26, 2013 at 12:04

Jakub MatczakJakub Matczak

15k5 gold badges48 silver badges61 bronze badges

0

You are effectively looking to rewrite URLs. If your web server is Apache you will be able to use the rewriting module (mod_rewrite) to direct requests to http://bakpinar.com/about/ to http://bakpinar.com/about/about-us.html

If you are not running Apache, most web servers will serve index.html as the default page when requesting a directory, so renaming

about-us.html

to

index.html

and changing incoming links to

/about/about-us.html 

to simply

/about/

Will give you the same results.

answered Oct 26, 2013 at 12:06

Code MonkeyCode Monkey

1,69511 silver badges13 bronze badges

0

How do I hide URL address in HTML?

By changing the display feature to "none", you will remove the link from the page layout. This may cause other elements of your page to move if they define their position in reference to your link. Changing your visibility to "hidden" will hide the link without influencing the page layout.

How do I hide my URL details?

How to hide authentication details in an URL.
STEP – 1: Create a variable that holds baseURL of the application. ... .
STEP – 2: Create a variable that holds username and password details. ... .
STEP – 3: Write a JavaScript function that gets parameter value that are present in the URL..
4. Type "" after the link word or phrase to close off the link. Your code should now look like this: LINK NAME , but will appear on your website as "LINK NAME" with the URL hidden.

How do I hide the URL of a video in HTML?

There is no way to hide the video URL entirely without resorting to browser plugins. You can obscure it though, but in most cases they won't be worth it. Using Media Source Extensions you can deliver segments of video data using obscured urls. And the URL won't be immediately visible in the source of the page.