Any PHP based software like WordPress, Mambo, Joomla, Drupal, MODx etc. will serve pages both from http://your-site.com as well as http://your-site.com/index.php .任何基於PHP的軟件一樣,在WordPress ,曼波, joomla , drupal , modx等,將服務的頁面都從http://your-site.com以及http://your-site.com/index.php This creates duplicate content for search engines, which may then decide to penalize your site for duplicate content.這將創建重複的內容為搜索引擎,其中可能,然後才決定要懲罰您的網站,重複的內容。 You can safely prevent duplicate content with the following apache code / directive added to your .htaccess file (or in httpd.conf):您可以放心地防止重複的內容與下列的Apache代碼/指令添加到您的。 htaccess的文件(或在httpd.conf ) :

RewriteEngine On關於rewriteengine
#Redirect plain index.php to home page without index.php #重定向平原的index.php首頁沒有的index.php
RewriteCond %{IS_SUBREQ} false rewritecond % ( ) is_subreq虛假
RewriteRule ^/index\.php$ http://blog.taragana.com [R=301,L] rewriterule ^ /指數\ 。 PHP的美元http://blog.taragana.com [ r = 301 ,升]

Replace http://blog.taragana.com with the url of your own site.取代http://blog.taragana.com與您自己網站的URL 。

What it does is redirect (301 - permanent redirect) all access to /index.php to /什麼它是重定向( 301 -永久重定向)的所有訪問/的i ndex.php/
However it does not redirect for internal requests.不過,這並不重定向內部的要求。 This is very important because when you are fetching http://blog.taragana.com, Apache actually creates an internal redirect to http://blog.taragana.com/index.php這是非常重要的,因為當你是擷取http://blog.taragana.com ,阿帕奇其實創建一個內部重定向到http://blog.taragana.com/index.php

The RewriteCond above ensures that only external accesses (from browsers, search engine bots etc) are only redirected to the canonical url of the site.該rewritecond以上,確保只有外部的通道(從瀏覽器,搜索引擎漫遊器等) ,只是重定向到典型的網站的網址。

Also it doesn’t redirect requests like this也沒有請求重定向喜歡這個 http://blog.taragana.com/index.php/archive/java-application-security-through-static-analysis/ , which contains index.php as part of the url. ,其中包含的index.php的一部分,該網址。 Only the exact url http://blog.taragana.com/index.php is redirected to http://blog.taragana.com只有確切網址http://blog.taragana.com/index.php重定向到http://blog.taragana.com