简体   繁体   English

Codeigniter问题访问/ admin

[英]Codeigniter issue accessing /admin

I have a script that was written using codeigniter. 我有一个使用codeigniter编写的脚本。

When accessed using a subdomain http://name.domain.com/admin/ it works fine but I now need to have the script installed in a folder and I cannot access http://domain.com/name/admin/ i just get a 404 使用子域http://name.domain.com/admin/访问时,它可以正常工作,但是我现在需要将脚本安装在文件夹中,而我无法访问http://domain.com/name/admin/得到404

I would guess (but I could be totally wrong) that it is a .htaccess issue. 我猜(但我可能完全错了),这是一个.htaccess问题。

RewriteEngine on
RewriteCond $1 !^(index\.php|install|updates|backups|images|css|js|uploads|jPicker|ckeditor|kcfinder|qr|fancybox|test\.php|licence\.txt|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

I would really appreciate any help to point me in the right direction so I can resolve this issue. 我真的很感谢您为我指明正确方向的任何帮助,以便我可以解决此问题。

Thanks 谢谢

{EDIT1} With NO .htaccess file name.domain.com/, name.domain.com/admin & domain.com/name all work, it is only domain.com/name/admin that does not work. {EDIT1}如果没有.htaccess文件name.domain.com/、name.domain.com/admin和domain.com/name都可以工作,则只有domain.com/name/admin不起作用。 When I add a .htaccess as above or the one in the second answer below the subdomain URL's still work but domain.com/name stops working and domain.com/name/admin continues not to work 当我如上所述添加.htaccess或子域URL下方的第二个答案中的一个仍然可用时,domain.com / name停止工作,domain.com / name / admin继续不工作

You should exclude also your name folder on your .htaccess: 您还应该在.htaccess上排除name文件夹:

RewriteEngine on
RewriteCond $1 !^(index\.php|install|updates|backups|images|css|js|uploads|jPicker|ckeditor|kcfinder|qr|fancybox|test\.php|licence\.txt|robots\.txt|name)
RewriteRule ^(.*)$ /index.php/$1 [L]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM