Rédiriger index.php vers example.com

S
StefouFR
Guest
Bonjour,

j'utilise un fichier .htaccess pour rediriger http://www.example.com vers example.com.
Voici le fichier .htaccess :
RewriteEngine On
RewriteCond %{HTTP_HOST} !^example\.com [NC]
RewriteRule (.*) http://example.com/$1 [QSA,R=301,L]
Par contre si je tapes example.com/index.php il n'y a pas de redirection.


Est-ce que vous savez si avec un .htaccess on peut rediriger index.php vers le domaine s'il vous plait ? Un peut à la même façon que le code que j'utilise plus haut.
 
WRInaute accro
Ajoutes donc ça à ton fichier:

Code:
RewriteCond %{REQUEST_URI} ^(/.*)?/index.(htm|html|php|asp)$
RewriteCond %{THE_REQUEST} /index.(htm|html|php|asp)
RewriteRule ^(.*)index.(htm|html|php|asp)$ /$1 [R=301,L]
 
Discussions similaires
Haut