dongre1907 2012-04-15 21:14
浏览 60
已采纳

CodeIgniter - Live site仅加载默认控制器的索引方法

I have been developing a CodeIgniter app in XAMPP on Windows 7. The app functions as expected locally but when uploaded it doesn't.

The default controller (ShowStadium) has the following methods: - index() - show()

index is loaded fine when called via the basepath, but neither loads when called directly:

/pathToApp/ShowStadium/ or /pathToApp/ShowStadium/index or pathToApp/ShowStadium/show

The error received is the Codeigniter 404 message.

The codeigniter instance is currently located in 2 subfolders. My .htaccess file:

RewriteEngine On

# Put your installation directory here:
# If your URL is www.example.com/, use /
# If your URL is www.example.com/site_folder/, use /site_folder/

RewriteBase /proj/groundtweet/

# Do not enable rewriting for files or directories that exist
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# For reuests that are not actual files or directories,
# Rewrite to index.php/URL
RewriteRule ^(.*)$ index.php/$1 [PT,L]

Things I have tried:

  • The controller files are all lower case.
  • The base path is correct both installations.
  • Tried the various uri_protocol options
  • index.php has been removed from the path.

Any help would be appreciated, because I can't find an answer to this problem specifically and it's frustrating in it's probable simplicity.

Apologies if I've missed any details here.

Thanks.

  • 写回答

3条回答 默认 最新

  • doudou0111 2012-04-16 23:06
    关注

    Thanks for all the answers, in the end it was a matter of case sensitivity.

    The controller filename was lowercase (showstadium.php) but referred to in form actions in Pascal case (ShowStadium).

    It seems that for the default controller/action, CodeIgniter works around this (I haven't had a look at the guts, so I'm just making an assumption here) but when called directly the filename must match the url case - on the linux server.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥50 h5唤醒支付宝并跳转至向小荷包转账界面
  • ¥15 算法题:数的划分,用记忆化DFS做WA求调
  • ¥15 chatglm-6b应用到django项目中,模型加载失败
  • ¥15 武汉岩海低应变分析软件,导数据库里不显示波形图
  • ¥15 CreateBitmapFromWicBitmap内存释放问题。
  • ¥30 win c++ socket
  • ¥15 C# datagridview 栏位进度
  • ¥15 vue3页面el-table页面数据过多
  • ¥100 vue3中融入gRPC-web
  • ¥15 kali环境运行volatility分析android内存文件,缺profile