URL重写/301重定向/SEO-一大困惑 [英] URL rewriting / 301 redirect / SEO - one big confusion

查看:174
本文介绍了URL重写/301重定向/SEO-一大困惑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,在这种情况下,我对如何实现自己的目标感到困惑.这是一个简单的案例.

我需要做的就是将www.example.com/blog重定向到blog.example.com,但是要重写URL,以便在链接www.example下显示blog.example.com的内容. .com/blog

www.example.com/blog位于我们托管的Windows 2003/IIS.6服务器上.
blog.example.com居住在DreamHost托管的WordPress上.

我了解我必须将重写内容放置在www.example.com所在的Windows服务器上,并进行相应的重定向.

所以我以为那会发生在我访问www.example.com/blog时,我会看到blog.example.com的内容(对吗?)

如果是这样,那么这就是我想要的.

因为所有这些都是SEO,所以我需要将blog.example.com重定向(301)到www.example.com/blog/以避免重复的内容-如本文http://www.seomoz.org/blog/url-rewrites-and-301 -redirects-how-does-it-all-work [ ^ ]

实际上,这是一个完整的循环,因此如果我错了,它将如何纠正我,但是www.example/blog会通过重写循环回到自身.这怎么工作?

我认为这行不通-您认为呢?上面的文章似乎很扎实.

任何解释/纠正的尝试将不胜感激.

Pav

Hi there I have a situation where I''m getting confused as to how my goal can be achieved. This is a simple case.

All I need to do is redirect www.example.com/blog to blog.example.com but in such a way that the URL is rewritten so it''s showing the content of blog.example.com under the link www.example.com/blog

www.example.com/blog lives on a Windows 2003/IIS.6 server hosted by us.
blog.example.com lives on WordPress hosted by DreamHost.

I understand that I have to place my rewrite on the Windows server where www.example.com lives and redirect accordingly.

So what I imagine that will happen is that when I go to www.example.com/blog I will see the content of blog.example.com (is that correct?)

If so then this is what I wanted but.

Because the reason for all this is SEO I would need the blog.example.com to redirect (301) to www.example.com/blog/ in order to avoid duplicate content - as explained in this article http://www.seomoz.org/blog/url-rewrites-and-301-redirects-how-does-it-all-work[^]

In effect this is a full loop, so how will it work correct me if I''m wrong but the www.example/blog will just loop back to itself via the rewrite. How can this work?

I don''t think it can work - what do you think? The article above seems solid though.

Any attempt to explain/correct will be much appreciated.

Pav

推荐答案

重写意味着您完全在一台服务器的服务器端执行此操作,告诉您Web服务器将浏览器请求的URL解释为另一个URL.客户端不了解内部重写.

您需要的是重定向.如您所述,这应该是301(永久)重定向,而不是临时(302)重定向.这样可以确保将链接汁"传输到另一个URL.

我也为自己的博客这样做. www.magerquark.de/blog [ blog.magerquark.de [ URL重写器 [
A rewrite means that you do, completely on the server side of one server, tell your web server to interpret an URL that is requested from a browser as another URL. The client has no knowledge of the internal rewrite.

What you want is a redirect. As you stated, this should be a 301 (permanent) redirect, not a temporary (302) redirect. This ensures that the "link juice" is transfered to the other URL.

I do this for my own blog, too. www.magerquark.de/blog [^] redirects to blog.magerquark.de [^] (both in German, you hardly will understand a word ;-)).

For IIS 6, I recommend URL rewriter [^], which is free of charge.

For IIS 7 and 7.5, please use the rewrite module (IIRC, it comes as an additional module to install).


您好,Uwe,

感谢您的答复,但不是,这不是我所需要的.我想要的是:

将www.example.com/blog重定向到blog.example.com,但以重写URL的方式来使它在链接www.example.com/blog下显示blog.example.com的内容"

这不是问题,这只是直接重写.

我不明白的是,然后按照我的发布的第二部分中所述将blog.example.com重定向到www.example.com/blog的情况.

实际上,我想将链接汁"提供给www.example.com/blog

干杯,

Pav
Hi there Uwe,

Thanks for your reply but no this is not what I need. What I want is:

"redirect www.example.com/blog to blog.example.com but in such a way that the URL is rewritten so it''s showing the content of blog.example.com under the link www.example.com/blog"

This is not a problem this is just a straight rewrite.

What I don''t understand is the bit when you then redirect blog.example.com to www.example.com/blog as described in the second part of my posting.

In effect I want to give the "link juice" to www.example.com/blog

Cheers,

Pav


您想要的东西称为反向代理.基本上,位于www.example.com的IIS Web服务器将获得请求,将其转换为另一台计算机(在本例中为blog.example.com)的URL,代表原始调用者发出页面请求并提供结果好像它来自www.example.com

Helicon Ape以合理的价格做到了这一点.

不过请注意,HTML未经处理就返回给客户端,这意味着它可能包含图像,脚本,锚点和其他与(相对于www.example.com而言)不是相对的URL,最终可能会将用户定向到blog.example.com.反正.为了解决这个问题,反向代理完成后,您将需要重写HTML.您可以为此在Ape中添加一个模块,也可以使用Javascript,但是您陷入了棘手的领域.
What you want is called a reverse proxy. Basically the IIS web server at www.example.com will get the request, translate it to a URL on another machine (in this case, blog.example.com), make the page request on behalf of the original caller and serve the result as though it had come from www.example.com

Helicon Ape does exactly this for a reasonable price.

Beware though, the HTML is returned to the client untreated, meaning that it may contain image, script, anchor and other URLs that are not relative (to www.example.com) and may end up directing the user to blog.example.com anyway. To address this you will need to rewrite the HTML once the reverse proxy has finished with it. You can add a module to Ape for that, or use Javascript, but you''re getting into tricky territory.


这篇关于URL重写/301重定向/SEO-一大困惑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆