I need to redirect the below url
http://localhost/CodeIgniter/index.php?/Welcome/
to
http://localhost/CodeIgniter/Welcome/
and I have tried the below in .htaccess
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9} /(.*)index.php($| |?)
RewriteRule ^ /%1 [R=301,L]
The above code taken me to below
http://localhost/CodeIgniter/?/Welcome/
I need to remove that ? mark for avoiding duplicate urls in seo. Can anybody help me
2
Answers
And you have to enable mod_rewrite
If you are using PHP version lower than 5.2.6 -> Remove the ? from index.php
You can try your code this way.