I have the following .htaccess command for redirection of php pages
RewriteRule ^(.*)$ index.php/$1 [L]
This code is working in localhost.It is not working in web server. But when code is slightly modified it works in server.
RewriteRule ^(.*)$ index.php?/$1 [L]
Why is this happening?
Best How To :
The reason this is happening is because you probably have different PHP versions running. I believe this has been considered a PHP bug for some time but don't quote me on that. You might be running an earlier version of PHP (Like maybe 5.2.X) on your localhost and newer on your web server. It's not an
.htaccess issue. It's PHP. You just have to know which one to use depending on the version.
Take this answer for reference as well.