1

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?

PeeHaa
  • 71,436
  • 58
  • 190
  • 262
Nithin Mohan
  • 750
  • 16
  • 34

1 Answers1

1

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.

https://stackoverflow.com/a/4365161/330987

Community
  • 1
  • 1
Panama Jack
  • 24,158
  • 10
  • 63
  • 95