Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I hide the full url of my website?

Tags:

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.

like image 680
buri Avatar asked Oct 26 '13 11:10

buri


1 Answers

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.

like image 67
Snowburnt Avatar answered Oct 05 '22 10:10

Snowburnt