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/9/ios/93.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 如何重定向外部URL,然后是mysite URL 我如何使用HTTAccess重定向我的站点中的外部(输出)URL,所以搜索引擎会把它们看作是本地的。 下面是一个例子: http://mysiteurl.com/links?http://externalurl.com_.htaccess_Url_Redirect_Hyperlink_External - Fatal编程技术网

.htaccess 如何重定向外部URL,然后是mysite URL 我如何使用HTTAccess重定向我的站点中的外部(输出)URL,所以搜索引擎会把它们看作是本地的。 下面是一个例子: http://mysiteurl.com/links?http://externalurl.com

.htaccess 如何重定向外部URL,然后是mysite URL 我如何使用HTTAccess重定向我的站点中的外部(输出)URL,所以搜索引擎会把它们看作是本地的。 下面是一个例子: http://mysiteurl.com/links?http://externalurl.com,.htaccess,url,redirect,hyperlink,external,.htaccess,Url,Redirect,Hyperlink,External,我有一个插件,可以转换常见的URL(比如http://externalurl.com)在html输出中添加到上述内容 现在,我只想在单击http://externalurl.com时,执行外部链接,并将访问者转移到http://externalurl.com 我试着用推杆 RewriteEngine On RewriteRule ^links?(.*) http://$1/ [L,R=301] 但不是像我想的那样工作。地址栏显示http://mysiteurl.com/links?http:/

我有一个插件,可以转换常见的URL
(比如http://externalurl.com)
在html输出中添加到上述内容

现在,我只想在单击
http://externalurl.com
时,执行外部链接,并将访问者转移到
http://externalurl.com

我试着用推杆

RewriteEngine On
RewriteRule ^links?(.*) http://$1/ [L,R=301]
但不是像我想的那样工作。地址栏显示
http://mysiteurl.com/links?http://externalurl.com
未重定向,并出现404错误

有什么帮助吗?感谢所有程序员。

将规则更改为

RewriteRule ^links$ %{QUERY_STRING} [L,R=301]

Thapaliyal ji nahi hua yr.没有成功。同样的结果。做了更新。这样行吗?您的.htaccess中还有其他规则吗?好的,完成了。我认为重写规则有冲突。用爱感谢你,因为你可能来自我的州。只是为了我的信息,更新是否有效,或者我之前回答了什么?我会更新答案,以备将来参考。@Elafanto,谢谢你让我知道。来自孟买/里什凯什的问候:)