I currently have a community site that I run that is made up of 15 or so php pages. It is not currently very dynamic, only using php for includes/templates.
我目前有一个社区网站,我运行它由15个左右的php页面组成。它目前不是非常动态,只使用php for includes / templates。
Currently no content is generated via a query string. The pages do not follow a standard naming convention and there are many inbound links.
目前,没有通过查询字符串生成内容。页面不遵循标准命名约定,并且有许多入站链接。
I am looking to expand the site (and start using query strings to build pages) but before I do this I want to change over to use pretty url’s. With this in mind I have a few questions though.
我正在寻找扩展网站(并开始使用查询字符串来构建页面),但在我这样做之前,我想改过来使用漂亮的网址。考虑到这一点,我有几个问题。
1) Is it best to point all requests to a url rewriting page catch any request to .php pages first and pass them through to keep existing links then a giant case statement for each of the 15 pages finally the rewrite the url's of new pages as these will follow a set format?
1)最好是将所有请求指向url重写页面首先捕获对.php页面的任何请求并传递它们以保留现有链接然后为15个页面中的每个页面创建一个巨大的case语句,最后将新页面的url重写为这些将遵循一套格式?
2) How can I prevent duplicates in google after I have updated my sitemap.xml or will it remove the old pages?
2)在更新了我的sitemap.xml后如何防止谷歌重复或者是否会删除旧页面?
Thanks
1) I'd redirect using apache's URL rewrite, and leave that static. It'll avoid the mess of having those 15 files you already have in your site.
I hope I have not misunderstood your question and this helps.
1)我使用apache的URL重写重定向,并保持静态。它可以避免在您的网站中拥有这15个文件。我希望我没有误解你的问题,这有帮助。
2) Edit robots.txt in the root of your website to tell google (and most others) what it should index, and what it shouldn't:
2)编辑网站根目录中的robots.txt,告诉谷歌(以及大多数其他人)它应该索引什么,以及它应该是什么:
Google有关此主题的信息:http://www.google.com/support/webmasters/bin/answer.py?hl = zh-CN&answer = 40360
更多信息:http://www.robotstxt.org/
You should use a 301 permanent redirect from the old pages to the new URLs. This will redirect users that follow links from the old to the new and Google will pass the PageRank you have accumulated on the old pages to the new one. You might also look at using Googles new canonical tag on the old pages to ensure they transfer authority to the new page.
您应该使用从旧页面到新URL的301永久重定向。这将重定向跟踪从旧链接到新链接的用户,Google会将您在旧网页上累积的PageRank传递给新网页。您还可以在旧页面上使用Googles新的规范标记来确保它们将权限转移到新页面。
http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html
In .htaccess, you want a bunch of
在.htaccess中,你想要一堆
redirect 301 /old/old.htm http://www.you.com/new.htm
重定向301 /old/old.htm http://www.you.com/new.htm
Regardless how its implemented, make sure any redirects use HTTP status 301, not the default (in may systems) of 302.
无论如何实现,都要确保任何重定向都使用HTTP状态301,而不是302的默认(在may系统中)。
302 = Moved 301 = Moved permanently.
302 =已移动301 =永久移动。
Using 301 helps google replace the old with the new URL, and should help pagerank etc carry over as well.
使用301有助于谷歌用新的URL替换旧的,并且应该帮助pagerank等继续进行。
本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.silva-art.net/blog/2009/05/17/69dc296fcaae649c2d6cfbba3ae0d900.html。