How to remove "index.php?" from HTACCESS [duplicate]
- by Francis Goris
This question already has an answer here:
Reference: mod_rewrite, URL rewriting and “pretty links” explained
2 answers
I have url like this:
www.site.com/index.php?/genero/aventura/av/
But I would like this to be my new url:
site.com/genero/aventura/av/
I used the following code:
<IfModule mod_rewrite.c>RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.site.com/$ [NC]
RewriteRule ^index.php\?/(.*)$ site.com/$1 [R=301,L]
</IfModule>
but only returns me: site.com/index.php?/genero/aventura/av/
This is my latest & full version:
RewriteEngine on
#RewriteCond $1 !^(index\.php|ver_capitulo\.html|google3436eb8eea8b8d6e\.html|BingSiteAuth\.xml |portadas|public|mp3|css|favicon\.ico|js|plantilla|i|swf|plugins|player\.swf|robots\.txt)
RewriteCond $1 !^(index\.php|public|css|js|i|feed|portadas|robots\.txt|BingSiteAuth\.xml|plugins|i|mp3|favicon\.ico|pluginslist\.xml|google3436eb8eea8b8d6e\.html)
RewriteRule ^(.*)$ /index.php?/$1 [L]
#DirectoryIndex index.php
#RewriteCond %{THE_REQUEST} http://www.page.com/index\.php [NC]
#RewriteRule ^(.*?)index\.php$ http://page.com/$1 [L,R=301,NC,NE]
#DirectoryIndex index.php
#RewriteEngine On
Thanks for reading.