WebSite X5Help Center

 
Azzurra F.
Azzurra F.
User

Redirect errore 404  it

Author: Azzurra F.
Visited 1570, Followers 1, Shared 0  

Ciao a tutti!

Mi è stato chiesto di risolvere un problema su un sito NON realizzato da me, in html: dato che molte pagine "vecchie" di quel sito sono state cancellate, ma sono ancora indicizzate, compaiono spesso errori 404 - url non trovato.

Per risolvere ho creato un file .htaccess (non ha estensione, ho già controllato) con all'interno soltanto il seguente codice:

ErrorDocument 404 /pagina-di-errore-404.html

Poi l'ho esportato sul server ma non funziona affatto.

Preciso che ho fatto vari tentativi:

  • inserire il file nella root del sito
  • creare cartella "htdocs" con dentro il file .htaccess ed inserire il tutto nella root del sito
  • inserire .htaccess nella cartella "public"

In cosa sto sbagliando??

grazie a tutti!

Azzurra

Posted on the
3 ANSWERS - 1 USEFUL
 lemonsong  
 lemonsong  
User

Il file .htaccess funziona su server Apache, verifica.

Possono essere caricati anche in cartelle ma le direttive inserite funzioneranno solo per le relative cartelle e sottocartelle.

Nel tuo caso va caricato nella root del sito.

Read more
Posted on the from  lemonsong  
Azzurra F.
Azzurra F.
User
Author

l' hosting è windows....

ho scoperto che devo creare un file web.config ma non mi è molto chiaro come devo procedere...

Read more
Posted on the from Azzurra F.
Azzurra F.
Azzurra F.
User
Author

ho trovato questo codice:

<?xml version="1.0" encoding="utf-8" ?>

<configuration>

  <system.web>
  </system.web>

  <appSettings>
  </appSettings>

</configuration>

e questo:

<customError mode="On" defaultRedirect="/error.html">
  <error statusCode="404" redirect="/not_found.html" />
</customError>

sono corretti? come creo il file, con blocco note e salvo web.config?

Read more
Posted on the from Azzurra F.