通过301重定向404误差的.htaccess的搜索引擎优化等 [英] Redirecting 404 error with .htaccess via 301 for SEO etc

查看:226
本文介绍了通过301重定向404误差的.htaccess的搜索引擎优化等的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找不到直接回答我的问题,需要从真正的专家知道这一点。

I couldn't find a straight answer to my question and need to know it from the real experts.

我这是是Joomla生成的URL一个网站。我相信万吨网址都是围绕在搜索引擎,我真的不知道这这一切。 302重定向将是一种选择,但我不能说这需要的URL重定向。

I had a website which urls were generated by Joomla. I believe that tons of urls are around in the search engines and I really don't know which of them all. A 302 redirect would be an option, but I can't say which urls need to be redirected.

我知道,所有的URL都被sef404脚本生成的唯一的事情,它是为Joomla搜索引擎优化脚本。

The only thing I know that all the urls were generated by a sef404 script, it's a SEO script for Joomla.

我的问题,我怎么能确保所有的谷歌和其他搜索引擎的孤儿的网址是否正确使用.htaccess文件交付?

My question, how can I make sure that all the orphan urls on google and other search engines are delivered correctly with a .htaccess file?

我如何301重定向所有的404页主页(根文件)

目前,我使用自定义404.html错误文件,但也有太多的文件,并给了自定义404错误页面过山车

At the moment I use a custom 404.html error file, but there are too many files and will give a rollercoaster of custom 404 error pages

推荐答案

您需要了解一些有关的URL,比如他们有一个特定目录或某些查询字符串元素,因为你必须匹配的东西。否则,你将不得不重新定向的404如果这是需要什么然后做这样的事情在你的.htaccess:

You will need to know something about the URLs, like do they have a specific directory or some query string element because you have to match for something. Otherwise you will have to redirect on the 404. If this is what is required then do something like this in your .htaccess:

ErrorDocument 404 /index.php

所以你不能使用www.mydomain.com一个错误页面重定向必须是相对于根。

An error page redirect must be relative to root so you cannot use www.mydomain.com.

如果你有一个模式来匹配太然后用301代替302,因为301是永久性的,302是暂时的。一个301将会从搜索引擎中删除旧的URL和302不会。

If you have a pattern to match too then use 301 instead of 302 because 301 is permanent and 302 is temporary. A 301 will get the old URLs removed from the search engines and the 302 will not.

现代重写参考:<一href="http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html">http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html

这篇关于通过301重定向404误差的.htaccess的搜索引擎优化等的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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