Ho provato questo e funziona benissimo:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase/
# Removes index.php from ExpressionEngine URLs
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteCond %{REQUEST_URI} !/system/.* [NC]
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]
# Directs all EE web requests through the site index file
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>
eccezioni
Se la directory di sistema del tuo sito (/ system /) è stata rinominata ed è ancora accessibile dall'URL, modificare la riga RewriteCond sopra:
RewriteCond %{REQUEST_URI} !/newdirectoryname/.* [NC]
Se si esegue EE da una sottodirectory piuttosto dalla radice del proprio dominio (ad es. http://example.com/myeesite/ anziché http://example.com/), basta rimuovere la barra dell'indice precedente.php nella linea RewriteRule sopra, in questo modo:
RewriteRule ^(.*)$ index.php/$1 [L]
Se si esegue EE da un sub-directory e ancora non funziona dopo la rimozione della barra, potrebbe essere necessario specificare la sub-directory nella vostra regola di riscrittura. Ad esempio, se il-sottocartella è denominata test, il cambiamento:
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]
A:
RewriteRule (.*?)index\.php/*(.*) testing/$1$2 [R=301,NE,L]
E il cambiamento:
RewriteRule ^(.*)$ /index.php/$1 [L]
A:
RewriteRule ^(.*)$ testing/index.php/$1 [L]
If your host requires forcing query strings, try adding a question mark following index.php in the RewriteRule line above, like so:
RewriteRule ^(.*)$ /index.php?/$1 [L]
Cosa stai cercando di fare? Cosa sta succedendo invece? Stai visitando '/index.php? Magic' e ti aspetti un reindirizzamento a'/magic'? – Tim
Il tuo host web sta eseguendo un server Apache: D? – bbedward
@TIM Ho un collegamento su 'www.mysite.com/post.php' che porta a' href = 'index.php'', e quel collegamento mi porta a 'www.mysite.com/index.php' invece di 'www.mysite.com' .... se questo ha un senso. – Norse