简体   繁体   English

CodeIgniter 发布函数在开发服务器上返回 404

[英]CodeIgniter post functions return 404 on dev server

Moved existing codeigniter app to a new server to perform some code updates.将现有的 codeigniter 应用程序移至新服务器以执行一些代码更新。 Everything is working correctly except any method that uses POST returns 404.除了使用 POST 的任何方法返回 404 外,一切都正常工作。

For example:例如:

function export_xls(){
   echo "HERE";
   if($this->input->post()){

I'll be able to hit the echo but it will then 404 at我将能够击中回声,但它会在 404

$this->input->post()

I've tried changing base_url in config.php and different things in htaccess to see if that helps but nothing has proven successful.我尝试更改 config.php 中的 base_url 和 htaccess 中的其他内容,看看是否有帮助,但没有任何证据证明是成功的。

All other functions where post values are not being called work perfectly.所有其他未调用 post 值的函数都可以正常工作。

Live url (where everything works) is http://admin.xxxxxx.com and dev is http://crm-admin.srv-y7z9u.xxxxxxx.com if that provides any insight. Live url (where everything works) is http://admin.xxxxxx.com and dev is http://crm-admin.srv-y7z9u.xxxxxxx.com if that provides any insight.

Try to check for some issues that can get in the way.尝试检查一些可能会妨碍您的问题。

First see if the link is being directed to the page correctly, then follow some steps that can help you:首先查看链接是否正确定向到页面,然后执行一些可以帮助您的步骤:

  1. Check base_url in your project settings.检查项目设置中的 base_url。
  2. Make sure you have not entered the wrong direction, as is quite common: http://crm-admin.srv-y7z9u.xxxxxxx.com/saveForm确保您没有输入错误的方向,这很常见: http://crm-admin.srv-y7z9u.xxxxxxx.com/saveForm 例子

see also $.post to Codeigniter Controller/Method 404 Page Not Found另请参阅$.post 到 Codeigniter 控制器/方法 404 页面未找到

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

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