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
对于单个URL,Apache.htaccess从https重定向到非https_Apache_.htaccess_Mod Rewrite_Redirect - Fatal编程技术网

对于单个URL,Apache.htaccess从https重定向到非https

对于单个URL,Apache.htaccess从https重定向到非https,apache,.htaccess,mod-rewrite,redirect,Apache,.htaccess,Mod Rewrite,Redirect,好的,在这里和谷歌上研究了这个。正在尝试获取https URL以重定向到非https URL 我尝试过各种组合,但此URL无效: 我只想重定向到 这没有发生;为我工作: RewriteCond %{HTTPS} on RewriteCond %{REQUEST_URI} ^/403\-perspectives\-from\-the\-editor\-in\-chief\-june\-2014$ RewriteRule .* "http\:\/\/www\.urotoday\.com\/403\

好的,在这里和谷歌上研究了这个。正在尝试获取https URL以重定向到非https URL

我尝试过各种组合,但此URL无效:

我只想重定向到

这没有发生;为我工作:

RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} ^/403\-perspectives\-from\-the\-editor\-in\-chief\-june\-2014$
RewriteRule .* "http\:\/\/www\.urotoday\.com\/403\-perspectives\-from\-the\-editor\-in\-chief\-june\-2014" [R=301,L]

将此规则放置在您的文档\u根htaccess中:

RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule ^(403-perspectives-from-the-editor-in-chief-june-2014)/?$ http://%{HTTP_HOST}/$1 [R=301,L,NC]

让我知道这是否有效。:)

@anubhava谢谢你,anubhava.:只需重新读取并将.htacess放在站点根目录中,就会导致整个站点404:(该规则仅针对一个文件,因此不会影响整个网站。您必须在该htaccess中有其他规则与此冲突,或者该htaccess存在其他问题。您能在该文件中看到类似的内容吗?您是刚刚从头开始创建该文件,还是已经创建了该文件,并且添加了这些行?@anubhava不是编码问题在ServerFault上发布,但如果在未来几天您有机会分享您的想法,我将不胜感激。:)我将研究这个问题,并在那里提供我的意见。