php 在地址栏中隐藏 URL 地址
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7938938/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
hiding the URL address in the address bar
提问by connor.p
I want to hide the url of the address bar but i have no idea how to do it, i have done some searching but found nothing.
On my website i want people to just see www.roundaboutmk.com on every page, no matter what link/button they click on.
for example, if they click on the "login" button it will take them to the url address www.roundaboutmk.com/login/login.php, i want to hide the "login/login.php"
我想隐藏地址栏的 url 但我不知道该怎么做,我做了一些搜索但什么也没找到。
在我的网站上,我希望人们在每个页面上都能看到 www.roundaboutmk.com,无论他们点击什么链接/按钮。
例如,如果他们点击“登录”按钮,它会将他们带到网址 www.roundaboutmk.com/login/login.php,我想隐藏“login/login.php”
Is this possible?
这可能吗?
Many thanks
connor
非常感
谢康纳
回答by Roman
- simplest: put your site into a frameset.
- simple: put your site into an iframe styled to fill the entire browser window.
- not so simple: recode your site to use ajax
- 最简单:将您的网站放入框架集。
- 简单:将您的网站放入 iframe 样式以填充整个浏览器窗口。
- 不是那么简单:重新编码您的网站以使用 ajax
1 is deprecated in HTML5, but still works
1 在 HTML5 中已弃用,但仍然有效
2 works
2件作品
3 wouldn't recommend it
3 不推荐
apart from the technical things... I wouldn't recommend doing this anyway. It's not userfriendly.
除了技术方面的事情......无论如何我都不建议这样做。它不是用户友好的。
回答by Poelinca Dorin
Make all links load their content using AJAX and replace the content of the current page, the problem is "you'll look realy bad in google eyes" if you don't atleast put a hash in the url.
使所有链接使用 AJAX 加载它们的内容并替换当前页面的内容,问题是“你在谷歌眼中看起来真的很糟糕”,如果你不至少在 url 中放置一个哈希值。
回答by Your Common Sense
You don't need it.
It seems you are under the impression of some sort of delusion.
While there are not a single reason to do that and whole lot of reasons to keep the url.
The url is not just for decoration, you know. It's on purpose.
你不需要它。
看来你有某种错觉。
虽然没有一个理由这样做,而且有很多理由要保留网址。
你知道,这个 url 不仅仅是用来装饰的。是故意的
Think your case over and then ask another question.
仔细考虑你的情况,然后再问另一个问题。
回答by Frank Cunning
It's not considered good style because nobody will be able to link to a specific piece of content on your site.
它不被认为是好的风格,因为没有人能够链接到您网站上的特定内容。
BUT: you can use a frameset with 100% like so:
但是:您可以像这样使用 100% 的框架集:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>Your Title</title>
</head>
<body>
<frameset rows="100%">
<frame src="index.html" name="Your Title" />
</frameset>
</body>
</html>
回答by Deniss Kozlovs
Not if you use the iframe where actual page processing is done, or all content is loaded via ajax requests.
如果您使用完成实际页面处理的 iframe,或者所有内容都通过 ajax 请求加载,则不会。
回答by frosty
Looks like there's no real answer on here. Let me provide an actual answer. Instead of going to each individual pages when you click on links, ect, you can just include every files on index depending on the POST name of the last link clicked.
看起来这里没有真正的答案。让我提供一个实际的答案。当您点击链接等时,无需转到每个单独的页面,您可以根据最后点击的链接的 POST 名称将每个文件包含在索引中。
For example, if an user click on a link going to login.php, set the action to index.php, and but set the POST value to login.php. Then when it goes to index.php, get the POST value. If the POST value is 'login.php', then include the file login.php. Same thing for all the other files. :)
例如,如果用户单击指向 login.php 的链接,则将操作设置为 index.php,并将 POST 值设置为 login.php。然后当它转到 index.php 时,获取 POST 值。如果 POST 值为“login.php”,则包含文件 login.php。所有其他文件也是如此。:)