RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteRule ^(.*)$ /index.php/$1 [L]
To explain what's happening here, assume you have this rewrite rule:
RewriteRule (.*) index.php?$1 [L]
Now, assume you go to www.example.com/welcome/hello. The rewritten URL is www.example.com/index.php?welcome/hello. Using ?$1 routing replaces $_GET with the URI, which prevents it from being used for anything else. It is only recommended to use ?$1 routing when you *want* to disable $_GET.
Okay. :( How about using the following?
# Enable rewriting
RewriteEngine on
# Installation directory
RewriteBase /
# Allow these directories and files to be displayed directly:
# - index.php (DO NOT FORGET THIS!)
# - robots.txt
# - favicon.ico
# - Any file inside of the media/ directory
# - WordPress content/ directory
RewriteRule ^(index\.php|robots\.txt|favicon\.ico|media) - [PT,L]
# Protect application and system files from being viewed
RewriteRule ^(application|modules|system) - [F,L]
# Rewrite all other URLs to index.php/URL
RewriteRule .* index.php/$0 [PT,L]
It's a stripped version of the Kohana website's .htaccess.
This is from CI, but this is really a mod_rewrite / PHP-as-CGI issue: no input file specified.
elseif (count($_GET) === 1 AND current($_GET) == '' AND substr($_SERVER['QUERY_STRING'], -1) !== '=')
{
…
}elseif (count($_GET) > 1 AND current($_GET) == '')
{
self::$current_uri = key($_GET);
// Fixes really strange handling of a suffix in a GET string
if ($suffix = Config::item('core.url_suffix') AND substr(self::$current_uri, -(strlen($suffix))) === '_'.substr($suffix, 1))
{
self::$current_uri = substr(self::$current_uri, 0, -(strlen($suffix)));
}
}
RewriteRule ^$ index.php [PT,L,QSA]
RewriteRule .* index.php?/$0 [PT,L,QSA]RewriteRule .* index.php/$0 [PT,L]RewriteRule .* index.php?$0 [PT,L] It looks like you're new here. If you want to get involved, click one of these buttons!