Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/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
.htaccess 非逻辑ascii字符重定向-HTACCESS_.htaccess_Redirect_Url Redirection_Http Status Code 301 - Fatal编程技术网

.htaccess 非逻辑ascii字符重定向-HTACCESS

.htaccess 非逻辑ascii字符重定向-HTACCESS,.htaccess,redirect,url-redirection,http-status-code-301,.htaccess,Redirect,Url Redirection,Http Status Code 301,有没有办法从以下位置进行301重定向: /@done 到 目前,我的.htaccess文件中有此代码: Redirect 301 /@done /bin 但是它没有重定向,因为语句中@的位置不合逻辑,有没有办法克服这个问题?结果URL仍然从example.com/@done的地址重定向 谢谢,@字符是URL中根据的保留字符。 您可以尝试改用字符的编码表示法%40是否有帮助 更新 您可以在Web服务器的适当位置创建文件夹@done,并在其中放入index.php文件。这将把所有请求从/@do

有没有办法从以下位置进行
301重定向

/@done

目前,我的
.htaccess
文件中有此代码:

Redirect 301 /@done /bin
但是它没有重定向,因为语句中
@
的位置不合逻辑,有没有办法克服这个问题?结果URL仍然从
example.com/@done
的地址重定向


谢谢

@
字符是URL中根据的保留字符。
您可以尝试改用字符的编码表示法
%40
是否有帮助


更新
您可以在Web服务器的适当位置创建文件夹
@done
,并在其中放入
index.php
文件。这将把所有请求从
/@done
重定向到
/bin

<?php
    header('HTTP/1.1 301 Moved Permanently');
    header("Location: /bin"); 
    header("Connection: close");           
?>

也许您可以尝试在不使用.htaccess的情况下解决此问题。我在php的帮助下添加了另一种方法。这对你有帮助吗?
<?php
    header('HTTP/1.1 301 Moved Permanently');
    header("Location: /bin"); 
    header("Connection: close");           
?>