2011-12-21 8 views
13

Attualmente sto configurando un sito Web da un cliente sul suo account di hosting. L'indirizzo del sito Web e per qualche motivo non è quello predefinito per i file .php (ovvero: index.php). Se metto index.php e non c'è alcun file index.html ricevo il seguente errore:Come impostare la pagina del sito web predefinita tramite htaccess?

If you feel you have reached this page in error, please contact the web site owner: [email protected] If you are the web site owner, it is possible you have reached this page because: The IP address has changed. There has been a server misconfiguration. The site may have been moved to a different server. If you are the owner of this website and were not expecting to see this page, please contact your hosting provider.

suo hosting è un hosting condiviso su cPanel.

risposta

24

Utilizzare la direttiva DirectoryIndex nel file .htaccess

DirectoryIndex index.php 
2

Prova

DirectoryIndex index.php 

se questo non dovesse funzionare potrebbe essere necessario lavorare intorno ad esso, fornendo index.html come

<html><frameset rows="*"><frame src="index.php"></frameset></html> 

(ofcourse più elaborato)

+0

Se si suggerisce già una soluzione di questo tipo, l'utilizzo del frame è assolutamente inutile: è sufficiente impostare il reindirizzamento con il tag corrispondente ''. –

3

Il problema è stato causato dalla cache del mio browser Web, non appena ho svuotato la cache ha funzionato!