简体   繁体   English

用PHP重写代码

[英]rewrite code in php

I have a problem with my client website. 我的客户网站有问题。

my client website is xyz.com/abc.php but unfortunately one of our external link webmaster has given slash at the end of the url as xyz.com/abc.php/ 我的客户网站是xyz.com/abc.php但是很遗憾,我们的外部链接网站站长之一在网址末尾加了斜杠xyz.com/abc.php/

now problem is google is reading text version pages of all the abc.php as duplicate content pages as cache text only version. 现在的问题是,谷歌正在读取所有abc.php文本版本页面,作为重复的内容页面作为仅缓存文本版本。

My webdeveloper has confirmed that these type of text version pages are not available in our root directory. 我的Web开发人员已经确认,这些类型的文本版本页面在我们的根目录中不可用。

Then how google is creating new pages in text version and indexing. 然后,谷歌如何在文本版本和索引中创建新页面。

is there is any problem in writing rewriting code? 编写重写代码有什么问题吗?

Kindly help me out/ 请帮助我/

If I understand your question correctly, it seems like Google is indexing multiple copies of your content with slightly different URLs. 如果我正确理解了您的问题,则似乎Google正在为您的内容的多个副本建立索引,而这些URL的网址略有不同。 If this is the case, then common SEO wisdom stipulates that duplicative content on a site does not help search engine page rank. 如果是这样,那么SEO的普遍智慧规定,网站上的重复内容无助于搜索引擎页面排名。

I would recommend using Apache URL rewriting to issue HTTP 301 Moved Permanently redirects for problem URLs, effectively telling search engines that the content is no longer available at problem URLs and that such URLs should not be indexed. 我建议使用Apache URL重写来发出问题URL的HTTP 301永久重定向,有效地告诉搜索引擎问题URL不再提供该内容,并且不应为此类URL编制索引。

could it be to do with relative linking to the css 可能与CSS的相对链接有关

ie xyz.com/layout.css and xyz.com/abc.php/layout.css xyz.com/layout.css和xyz.com/abc.php/layout.css

if you are linking to the css using just the relative link layout.css then it will add after the abc.php/ (xyz.com/abc.php/layout.css). 如果仅使用相对链接layout.css链接到CSS,则它将在abc.php /(xyz.com/abc.php/layout.css)之后添加。 whereas if you use /layout.css it'll go to the root url xyz.com then add /layout.css (xyz.com/layout.css). 而如果你使用/layout.css它会去根URL xyz.com然后加入/layout.css(xyz.com/layout.css)。

alternatively put all css etc. links in as absolute http:// www.xyz.com/layout.css 或者将所有css等链接放置为绝对http:// www.xyz.com/layout.css

hope that makes sense and helps 希望有意义并有所帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM