• Regolamento Macrocategoria DEV
    Prima di aprire un topic nella Macrocategoria DEV, è bene leggerne il suo regolamento. Sei un'azienda o un hosting/provider? Qui sono anche contenute informazioni per collaborare con Sciax2 ed ottenere l'accredito nella nostra community!

Problema risolto Nascondere estensione htaccess

snakom23

Utente Normale
Autore del topic
12 Febbraio 2014
67
0
Miglior risposta
0
Salve gente ho necessita di nascondere l'estensione delle mie pagine. Ho usato questo codice ma nulla:
Codice:
Perfavore, Entra oppure Registrati per vedere i codici!
 
Ti posto i vari codici :
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]

E quello che uso io :
# If not a directory, remove the trailing slash
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/$ $1 [R=301,L]

# Redirect external .php requests to an extensionless url
RewriteCond %{THE_REQUEST} ^(.+)\.php([#?][^\ ]*)?\ HTTP/
RewriteRule ^(.+)\.php$ $1 [R=301,L]

# Resolve extensionless php url, to the php file
RewriteRule ^([^/.]+)$ $1.php [L]