I'm trying to set up CodeIgniter from an existing site that's on nginx. My local machine is Apache and this is the redirect scheme on nginx. How do I write this using RewriteRules?
if ($host ~* ^www\.(.*)) {
set $host_without_www $1;
rewrite ^(.*)$ http://$host_without_www$1 permanent;
}
if ($request_uri ~* ^(/welcome(/index)?|/index(.php)?)/?$){
rewrite ^(.*)$ / permanent;
}
if ($request_uri ~* index/?$){
rewrite ^/(.*)/index/?$ /$1 permanent;
}
if (!-d $request_filename){
rewrite ^/(.+)/$ /$1 permanent;
}
if ($request_uri ~* ^/system){
rewrite ^/(.*)$ /index.php?/$1 last;
break;
}
if (!-e $request_filename){
rewrite ^/(.*)$ /index.php?/$1 last;
break;
}