How To Safely Redirect /index.php To / Using .htaccess / Apache Come sicura di reindirizzamento / index.php Per / Usare. 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 . Qualsiasi software basato su PHP come WordPress, Mambo, Joomla, Drupal, ecc MODx servirà da entrambe le pagine http://your-site.com così come http://your-site.com/index.php. This creates duplicate content for search engines, which may then decide to penalize your site for duplicate content. Questo crea contenuti duplicati per i motori di ricerca, che può quindi decidere di sanzionare il suo sito per contenuti duplicati. You can safely prevent duplicate content with the following apache code / directive added to your .htaccess file (or in httpd.conf): Si possono tranquillamente evitare duplicati con il seguente codice apache / direttiva aggiunto al tuo. Htaccess file (o in httpd.conf):
RewriteEngine On RewriteEngine su
#Redirect plain index.php to home page without index.php # Index.php pianura di reindirizzamento alla pagina iniziale senza index.php
RewriteCond %{IS_SUBREQ} false RewriteCond% () IS_SUBREQ falsi
RewriteRule ^/index\.php$ http://blog.taragana.com [R=301,L] RewriteRule ^ / indice \. Php $ http://blog.taragana.com [R = 301, L]
Replace http://blog.taragana.com with the url of your own site. Http://blog.taragana.com sostituire con l'url del vostro sito.
What it does is redirect (301 - permanent redirect) all access to /index.php to / Ciò che fa è reindirizzare (301 - redirect) l'accesso a tutti i / index.php a /
However it does not redirect for internal requests. Tuttavia, non per reindirizzare le richieste interne. 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 Questo è molto importante perché, quando si sono http://blog.taragana.com recupero, Apache effettivamente interno crea un reindirizzamento al 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. La RewriteCond sopra assicura che solo gli accessi esterni (da browser, motore di ricerca bot ecc) sono solo reindirizzato alla canonica url del sito.
Also it doesn’t redirect requests like this Anche non reindirizzare le richieste di questo tipo http://blog.taragana.com/index.php/archive/java-application-security-through-static-analysis/ , which contains index.php as part of the url. , Che contiene index.php come parte della url. Only the exact url http://blog.taragana.com/index.php is redirected to http://blog.taragana.com Solo l'URL esatto http://blog.taragana.com/index.php viene reindirizzato a http://blog.taragana.com
Filed under Elencato sotto Headline News Headline News , How To Come , Linux , Web , Web Hosting Web Hosting | |
| |
RSS 2.0 RSS 2,0 | |
Trackback this Article | questo articolo |
Email this Article Invia questo articolo
You may also like to read Si può anche leggere come |




