Se vogliamo che il nostro sito, nel caso di errore 404 ("not found"), invece di dare il messaggio di errore reindirizzi l'utente in home page, è sufficiente aggungere al file .htaccess il seguente comendo:

ErrorDocument 404 /index.html

Ciò è comodo se, dopo una riorganizzazione del sito, abbiamo numerosi link esterni che puntano a link non più esistenti; la soluzione migliore (anche dal punto di vista SEO) sarebbe quella di ricostruire ogni specifico link, assegnandogli un corrispondente redirect, ma la cosa potrebbe essere molto macchinosa e portare alla generazione di migliaia di redirect.
Ed anche in questo caso, sicuramente ce ne sarà qualcuno che ci sarà sfuggito... quindi in questi casi reindirizzare l'utente verso la home page potrebb essere comunque una scelta preferibile rispetto al messaggio di "error 404".

Found this article interesting?
Subscribe to DomainRegister´s newsletter!

You can unsubscribe at any time by simply clicking the link in the footer of our emails. For information about our privacy practices, please visit our website.

We use Mailchimp as our marketing platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp s privacy practices here.

  • .htaccess
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

 Linux Directory and File Structure

Linux Directory/Folder StructureFrom amongst the several directories found within your cPanel...

 Shared Linux Hosting Plans Technical Specifications

    Cardboard Basic Starter disk space 10 MB 1 GB 2 GB monthly traffic 20...

 Reseller Linux Hosting Plans Technical Specifications

    Starter disk space as provided by plan monthly traffic as provided by plan...

 DNS Configuration for Shared Hosting Plans

In order to use our Linux Shared Hosting Plans, you need point the domain using one of the...

 How to backup your site to a FTP server with cPanel

cPanel offers an easy and powerful way to backup your site, storing your backup set on a remote...