How To Safely Redirect /index.php To / Using .htaccess / Apacheどのように安全にリダイレクト/ index.phpをを/を使用して、 。 htaccessを/ Apacheの
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 on経験上、
#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 [研究= 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ため、実際に作成する内部にリダイレクトされるApacheの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により、外付けのアクセスのみ(ブラウザ、検索エンジンロボット等)は、正規のURLをリダイレクトされるだけのサイトです。
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は、正確なURLにリダイレクトさhttp://blog.taragana.com/index.phpはhttp://blog.taragana.com
Filed under提出されて Headline Newsニュースの見出し , 、 How Toどのように , 、 Linuxリナックス , 、 Webウェブ , 、 Web Hostingウェブホスティング | |
| |
RSS 2.0 RSS 2.0を | |
Trackbackトラックバック this Article |この記事|
Email this Article電子メールこの記事
You may also like to readを読むようにすることも可能 |




