- Home
- Categorie
- Coding e Sistemistica
- Coding
- Errore 404 se non presente index.html in url
- 
							
							
							
							
							
Errore 404 se non presente index.html in urlCiao. Ho un sito dove è presente una pagina (index.php) che fa girare il sito con htaccess leggendo da database. Esempio: www . sito . it/categoria/ articolo .html Codice htaccess: RewriteRule ^(.*).html$ index.php?id=$1&pag=$2 [QSA,L] RewriteCond %{THE_REQUEST} ^(.)index.php 
 RewriteCond %{THE_REQUEST} ^(.)index.html
 RewriteRule ^(.)index.php$ http : // www . sito . it/ [R=301,L]
 RewriteCond %{HTTP_HOST} ^sito . it
 RewriteRule (.) http : // www . sito . it/$1 [R=301,L]anche per fare in modo che l'url principare del sito sia www . sito . it/ che però restituisce 404 se non l'url non è www . sito . it / index .html Nel file index . php ho inserito una clausola $get_id = $_GET['id']; if($get_id==''){$get_id = "indice";} che impone di adottare la variabile 'indice' se nell'url non è presente nulla, di modo che possa leggere la homepage, ma invece mi restituisce 404 se manca nell'url index . html Come posso risolvere?