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, Mambo, 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, L]
Replace http://blog.taragana.com with the url of your own site. Заменить http://blog.taragana.com в адрес Вашего собственного сайта.
What it does is redirect (301 - permanent redirect) all access to /index.php to / Что она делает это переадресация (301 - постоянная переадресация) всех доступ к / index.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 выше гарантирует, что только внешний доступ (от браузеров, поисковой системы ботов и т.д.) являются лишь переадресация на канонической ссылкой на указанный сайт.
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
Filed under Поданного в соответствии с Headline News 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 Вы можете также люблю читать |




