Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
哈希键URL参数?_Url_Hash_Rewrite_Ip Address - Fatal编程技术网

哈希键URL参数?

哈希键URL参数?,url,hash,rewrite,ip-address,Url,Hash,Rewrite,Ip Address,如何生成此类型的url: http://www.foo.bar/#/project/123 在.htaccess文件中,您可以设置重写(如果您使用的是Linux)。在Windows计算机上,您将使用IIS进行重新写入 有关Javascript中的更多信息,请参阅: location.hash = "/project/123"; 然后在应用程序加载时检查散列,并将用户重定向到“散列”url if(!!location.hash) { location.href = "http://fo

如何生成此类型的url:

http://www.foo.bar/#/project/123

在.htaccess文件中,您可以设置重写(如果您使用的是Linux)。在Windows计算机上,您将使用IIS进行重新写入

有关Javascript中的更多信息,请参阅:

location.hash = "/project/123";
然后在应用程序加载时检查散列,并将用户重定向到“散列”url

if(!!location.hash) {
    location.href = "http://foo.bar" + location.hash.substring(1);
}