WebSite X5Help Center

 
Azzurra F.
Azzurra F.
User

Redirect errore 404  it

Автор: Azzurra F.
Просмотрено 1587, Подписчики 1, Размещенный 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

Размещено
3 Ответы - 1 Полезно
 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.

Читать больше
Размещено От  lemonsong  
Azzurra F.
Azzurra F.
User
Автор

l' hosting è windows....

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

Читать больше
Размещено От Azzurra F.
Azzurra F.
Azzurra F.
User
Автор

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?

Читать больше
Размещено От Azzurra F.