我正在使用PHP,Ajax,JS和HTML,经过多次搜索后,我发布的是go-google-plexed。
如何让访问www.foo.com/bar的用户访问www.foo.com/index.php并使用 bar 作为输入?
我想避免为每个可能的值创建一个文件夹。
我想在地址栏中保留/栏
答案 0 :(得分:2)
在这里使用Apache mod_rewrite example或using php,但是这样的uri:
http://example.com/index.php/controller/action/variables
答案 1 :(得分:0)
您想查看mod_rewrite。
答案 2 :(得分:0)
检查位置并通过javascript更改为您想要的任何内容:
<script type="text/javascript">
// var x = ( cut out part of the current location )
// Then replace with whatever:
location.replace('http://www.example.com/');
</script>
示例:
http://www.tizag.com/javascriptT/javascriptredirect.php
http://andylangton.co.uk/articles/javascript/javascript-redirect-scripts/
http://www.javascriptredirect.com/timed.htm
此外,这里有一个替代mod_rewrite的php(这是你应该使用的,但如果你不能,还有其他方法):