我怎样才能隐藏我的网站的完整网址? [英] How can i hide the full url of my website?

查看:149
本文介绍了我怎样才能隐藏我的网站的完整网址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我将我的网站文件上传到我的服务器并转到我的网站时,我在浏览器的url栏中看到index.html。我怎么能隐藏这个?



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



我希望这个例子看起来像这样;



http://www.royaltyline.com



如您所见,您只能在浏览器的网址栏中看到网址。当您点击另一个页面时,它不会显示.php,.asp或.html扩展名,只显示文件夹名称。


$ b $ p



burak

解决方案

隐藏你所需要的页面的扩展名控制服务器。在PHP中,您可以使用.htaccess文件来定义mod_rewrite规则,该规则根据用户尝试访问的URL来重写url。
在IIS(Windows)中,您可以设置当用户访问特定站点时出现的默认页面。对于与.htaccess类似的功能,您可以在IIS 7及以上版本中安装应用程序请求路由模块。



您也可以设置为使所有页面都可以通过使用AJAX的相同页面或将所有内容放在同一页面上,并使用CSS将其隐藏并使用CSS和/或javascript显示。



这是一个非常高级的答案因为具体情况因情况而异。

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.

tia

burak

解决方案

to hide the extension of the page that you are on you need to have control of the server. In php you can use the .htaccess file to define mod_rewrite rules that rewrite the url based on the URL the user is trying to get to. In IIS (windows) you can set up default pages that come up when users go to particular sites. For similar features to .htaccess you can install the application request routing module in IIS 7 and above.

You can also make it so 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 javascript.

This is a very high level answer because the specifics vary greatly from situation to situation.

这篇关于我怎样才能隐藏我的网站的完整网址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆