Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/432.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
是否可以使用.htaccess或javascript更改完整url?_Javascript_Apache_.htaccess_Mod Rewrite - Fatal编程技术网

是否可以使用.htaccess或javascript更改完整url?

是否可以使用.htaccess或javascript更改完整url?,javascript,apache,.htaccess,mod-rewrite,Javascript,Apache,.htaccess,Mod Rewrite,我正在尝试反转我网站的完整url: www.example.com 进入 moc.elpmaxe.www 我通过在javascript中使用window.document.location.hash和.htaccess的mod_rewrite函数,成功地在散列后更改了url,最后得到了如下结果:www.example.com/#moc.elpmaxe.www 我认为这是不可能的,因为安全原因或者moc.elpmaxe.www不是有效的url。但如果有一些可能性,那就太好了 我的.htaccess

我正在尝试反转我网站的完整url:

www.example.com 进入 moc.elpmaxe.www

我通过在javascript中使用window.document.location.hash和.htaccess的mod_rewrite函数,成功地在散列后更改了url,最后得到了如下结果:www.example.com/#moc.elpmaxe.www

我认为这是不可能的,因为安全原因或者moc.elpmaxe.www不是有效的url。但如果有一些可能性,那就太好了

我的.htaccess:

Options -MultiViews
RewriteEngine On

RewriteCond %{THE_REQUEST} \s/index.html\s [NC]
RewriteRule ^ /moc.elpmaxe.www [R=301,L]
我使用的javascript:

window.document.location.hash = "lmth.xedni\moc.elpmaxe.www";

我高度怀疑这是可能的,因为如果这是可能的话,已经有网站使用它来欺骗其他网站


例如,它可以将其url从
www.badsite.com
更改为
www.superrealbank.com

我高度怀疑这是可能的,因为如果可能的话,已经有网站使用它来欺骗其他网站

例如,它可以将其url从
www.badsite.com
更改为
www.superrealbank.com