CodeIgniter multi-application .htaccess problem

后端 未结 1 1852
慢半拍i
慢半拍i 2020-12-07 00:16

I have a problem with CodeIgniter .htaccess file and hope that somebody can help me! I don\'t know regular expressions or how to use the .htaccess, I\'m very new with this t

相关标签:
1条回答
  • 2020-12-07 01:01

    First of all this is redundant:

    RewriteCond $1 !^(index\.php|images|robots\.txt)
    

    because your other conditions already take care of existing files and directories so I'd suggest to remove it.

    Your rewrite rule is wrong if you want /admin to rewrite to admin.php, with your current rule it will result in /index.php/admin. You didn't mention if that's the problem, if it is do this:

    RewriteRule ^/admin$ admin.php [L,QSA]
    RewriteRule ^(.*) index.php/$1 [L,QSA]
    

    Also you can debug the rewriting using RewriteLog: http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html#rewritelog

    If that doesn't fix it please describe the current behaviour and what you expect, otherwise it's difficult to help.

    0 讨论(0)
提交回复
热议问题