标签: http-status-code-301

.htaccess 301重定向没有GET var

对于我目前正在处理的网站,我们将旧网址永久重定向到这样的新网址:Redirect 301 /oldfile.php http://www.site.com/show/newurl

现在我遇到了这种情况,其中旧的url有一个get var:Redirect 301 /oldfile.php?var=name http://www.site.com/show/newurl

这会将旧文件重定向到新的url,并添加get var,以便重定向到:http://www.site.com/show/newurl? var = name

如何在没有get var的情况下设置此重定向?

.htaccess get http-status-code-301

3
推荐指数
1
解决办法
3708
查看次数

如何通过Web.config或C#将所有内容重定向到https:// www.该网站的版本?

我在GoDaddy上托管了一个ASP.NET网站.我需要将每个请求重定向(301)到https://www.example.com/whatever

例如:

这在Linux或cPanel主机上是小菜一碟.但是我不知道怎么在GoDaddy上做这个(我问过支持,但他们似乎什么都不知道......).我想用IIS很容易,但是GoDaddy没有给你IIS访问权限.

那么有没有办法通过Web.config或C#来做到这一点?最好是web.config

asp.net redirect http-status-code-301

3
推荐指数
1
解决办法
3115
查看次数

如何在web.config中配置301永久重定向?

我很乐意使用web.config来执行从旧域到另一个域的301重定向.我怎么能这样做?

在你的答案中,请记住IIS是v7和

我不想使用任何第三方DLL像urlrewriteing.net等或使用ASP.NET代码或配置IIS,为此.

我相信这可以做到,但是怎么做?

更新:我尝试了Parvesh的答案,但我感觉不是"正式"支持或者我正在制造其他非常错误的东西.

asp.net redirect iis-7 web-config http-status-code-301

3
推荐指数
1
解决办法
1万
查看次数

Application.cfm在301重定向后缺少会话变量

运行ColdFusion 7.

Application.cfm将所有session变量循环到request.session

OnRequestEnd.cfm将所有request.session值循环回session

它这样做所以它只需要在单个事务中编写变量时锁定范围一次.(我相信这不再是一个问题了吗?但我不能完全撕掉它).

我有一个'redirect.cfm'页面,它提供301重定向到SEO URL或传递内容.某些表单发布到旧URL,因此需要301重定向,这会导致POST数据丢失.这就是我打算如何处理它.

<!--- if form scope exists (posted data) copy it to the request.session scope ---> 
<cfif structKeyExists(form,'fieldNames')>
    <cfset request.session.postData = structCopy(form)>
</cfif>
Run Code Online (Sandbox Code Playgroud)

然后它继续进行301重定向,当它返回redirect.cfm以传递内容时,它运行此代码

<!--- if request.session.postData exists (posted data) copy it to the form scope --->
<cfif structKeyExists(request.session,'postData')>
    <cfset form = structCopy(request.session.postData)>
    <cfset StructDelete(request.session,'postData')>
</cfif>
Run Code Online (Sandbox Code Playgroud)

如果从数据发布中不需要301重定向,这可以正常工作.

通过301重定向,我确认了Application.cfm,OnRequestEnd.cfm都运行了两次(一次用于初始301,一次用于内容传送).

在第一个OnRequestEnd.cfm调用结束时,session.postdata使用表单数据正确填充.

301重定向后,它再次点击Application.cfm session.postdata返回'struct [empty]'

有帮助吗?谢谢

coldfusion http-status-code-301 coldfusion-7 application.cfm

3
推荐指数
1
解决办法
548
查看次数

Node.js 303连接到AWS-SDK时的永久重定向

下午好,

我正在尝试建立与我的aws产品api的连接,但是我一直收到301永久重定向错误,如下所示:

{ [PermanentRedirect: The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.]
  message: 'The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.',
  code: 'PermanentRedirect',
  name: 'PermanentRedirect',
  statusCode: 301,
  retryable: false }
Run Code Online (Sandbox Code Playgroud)

我用来连接API的代码如下:

var aws = require('aws-sdk');

//Setting up the AWS API
aws.config.update({
    accessKeyId: 'KEY',
    secretAccessKey: 'SECRET',
    region: 'eu-west-1'
})

var s3 = new …
Run Code Online (Sandbox Code Playgroud)

javascript amazon-s3 amazon-web-services node.js http-status-code-301

3
推荐指数
1
解决办法
4087
查看次数

SEO - 301重定向通过404页面

我是新手,所以我会尝试清楚地解释自己.

我正在从自定义404页面进行301重定向.现在我开始工作了我的问题更多是关于谷歌如何对待它.因为我们去404页面谷歌只是将它记录为40页或者它实际记录301?正如我所说,我是新手,并通过谷歌试图找到答案.

无论如何,任何帮助或评论都会受到极大关注.提前致谢

seo http-status-code-404 http-status-code-301

3
推荐指数
1
解决办法
3717
查看次数

301永久移动

我正在尝试通过Java在URL中获取HTML.但301 Moved Permanently就是我所拥有的一切.另一个URL工作.怎么了?这是我的代码:

 hh= new URL("http://hh.ru");
        in = new BufferedReader(
                new InputStreamReader(hh.openStream()));


        while ((inputLine = in.readLine()) != null) {

            sb.append(inputLine).append("\n");
            str=sb.toString();//returns 301


        }
Run Code Online (Sandbox Code Playgroud)

html java http http-status-code-301

3
推荐指数
1
解决办法
2万
查看次数

htaccess 301重定向通配符以获取新的基本域名

我做SEO的公司已经改变了他们的域名.

我写了301重写来将流量重定向到新域.到目前为止,我有3个更改的重写,其中有很多.当我完成所有操作时,将会有大约30次重写,这看起来有点傻!

是否有一个通配符我可以使用,只要确保以下3个参数满足?

  1. 必须始终指向www.版.
  2. 必须始终指向co.uk版本.
  3. 必须始终将旧URL更改为新URL.

这将是这样的......

(.*)example-old(.*) = www.example-new.co.uk

(.*)example-old(.*)/(.*) = www.example-new.co.uk/directory

下面的代码对问题3进行了排序,但它并不能解决所有问题.

如果我可以使用一小段代码,它使用通配符,这将是完美的.

任何帮助,非常感谢!


# 301 --- http://example.co.uk => http://www.example-new.co.uk
RewriteCond %{HTTP_HOST} ^example\.co\.uk$
RewriteRule ^$ http://www.example-new.co.uk/? [L,R=301]

# 301 --- http://www.example.co.uk => http://www.example-new.co.uk
RewriteCond %{HTTP_HOST} ^www\.example\.co\.uk$
RewriteRule ^$ http://www.example-new.co.uk/? [L,R=301]

# 301 --- http://example.com => http://www.example-new.co.uk
RewriteCond %{HTTP_HOST} ^example\.com$
RewriteRule ^$ http://www.example-new.co.uk/? [L,R=301]

# 301 --- http://www.example.com => http://www.example-new.co.uk
RewriteCond %{HTTP_HOST} ^www\.example\.com$
RewriteRule ^$ http://www.example-new.co.uk/? [L,R=301]
Run Code Online (Sandbox Code Playgroud)

.htaccess mod-rewrite seo http-status-code-301

3
推荐指数
1
解决办法
1万
查看次数

没有-v,301卷曲不会显示

我正在查看几个2.level域用于重定向到他们的www 3.level域的301,我认为卷曲本身就足够了,例如

curl  myvote.io
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.myvote.io/">here</A>.
</BODY></HTML>
Run Code Online (Sandbox Code Playgroud)

但是,我必须使用curl -v来获取另一个域上的任何输出:

curl -v evitaochel.com
* Rebuilt URL to: evitaochel.com/
* Hostname was NOT found in DNS cache
*   Trying 62.116.130.8...
* Connected to evitaochel.com (62.116.130.8) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.35.0
> Host: evitaochel.com
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Date: Mon, 13 Oct 2014 16:18:02 GMT
* Server Apache is not blacklisted …
Run Code Online (Sandbox Code Playgroud)

redirect curl http-status-code-301

3
推荐指数
1
解决办法
2万
查看次数

Powershell确定永久移动(重定向)的资源的新URL

我在Linux上使用AppImage使用Powershell Core v6-beta.5。有没有办法找出301重定向的“新”位置?

Invoke-WebRequest -Method HEAD http://SomethingThatThrows301.com/ -MaximumRedirection 0引发错误(Response status code does not indicate success: 301 (Moved Permanently))。

虽然错误确实提到此举是301,但我仍然希望有一个适当的对象告诉我,以及新地址。

有办法吗?

powershell http-status-code-301 url-redirection powershell-v6.0

3
推荐指数
1
解决办法
2487
查看次数