.htaccess - Redirecting everything to index.php and stripping last slash -
i have code below redirect requests (except files) index.php unfortunately cannot script work because of strange mime type error happening when url ends slash.
the strange part code output same both urls error appears in / ending one.
so i'm looking way redirect request it's working right withouth slash or solve mime type issue, have no idea causing it...
<ifmodule mod_rewrite.c> options +followsymlinks # options +symlinksifownermatch rewriteengine on # redirect /index.php / (optional, recommended guess) rewritecond %{the_request} ^[a-z]{3,9}\ /.*index\.php rewriterule ^index.php/?(.*)$ $1 [r=301,l] # run else real files through index.php rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^(.*)$ index.php/$1?%{query_string} [l] </ifmodule>
<ifmodule mod_rewrite.c> options +followsymlinks rewriteengine on rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^(.*)$ index.php/$1 [qsa,l] </ifmodule> qsa = query string append, preserve query string.
if index.php file, , file exists it'll not pass on test, there's no need of first rewritecond block.
Comments
Post a Comment