php - Not Found The requested URL /singlecodebase/Feb152017/login was not found on this server -
login page shows on login getting error not found
the requested url /singlecodebase/feb152017/login not found on server. httpd.conf file? using digital ocean cloud server. code uses codeigniter version 2
my .htaccess file below
<ifmodule mod_rewrite.c> rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule .* index.php/$0 [pt,l] </ifmodule>
my login controller is: login.php
<?php class login extends ci_controller { var $data; function __construct() { parent::__construct(); $this->load->helper('cookie'); $this->load->library('session'); $is_admin_logged_in = $this->admin_init_elements->admin_logged_in_status(); global $user; if($is_admin_logged_in == true){ redirect('home'); //; } //populate viewfor header / footer elements $this->admin_init_elements->init_elements('n'); $this->load->model('mod_login'); } function index(){ //if admin logged in, send admin home $this->data['message']=''; $this->data['msg_class'] = ''; $post_array=$this->input->post(); $data['old_images']=$this->mod_common->getbgimages(); if($this->input->cookie('remember') == 'on') { //echo $this->input->cookie('username'); $this->data['message']=strip_tags($this->mod_login->check_cookie_login()); if($this->data['message']=='login successful'){ $this->data['msg_class'] = 'sukses'; redirect('home'); }else{ $this->data['msg_class'] = 'gagal'; } } if($this->input->post('action')=='adminlogin'){ //print_r($this->input->post()); die; if(isset($post_array['remember'])){ $username_cookie= array( 'name' => 'uusername', 'value' => $post_array['username'], 'expire' => '865000', 'secure' => false ); $password_cookie= array( 'name' => 'userpass', 'value' => $post_array['userpass'], 'expire' => '865000', 'secure' => false ); $remember_cookie= array( 'name' => 'remember', 'value' => 'on', 'expire' => '865000', 'secure' => false ); $this->input->set_cookie($username_cookie); $this->input->set_cookie($password_cookie); $this->input->set_cookie($remember_cookie); //die; } else { if($this->input->cookie('remember') == 'on') { if($this->input->cookie('uusername') != $post_array['username']) { delete_cookie("remember"); delete_cookie("uusername"); delete_cookie("userpass"); } } } $this->data['message']=strip_tags($this->mod_login->validate_admin_login()); if($this->data['message']=='login successful'){ $this->data['msg_class'] = 'sukses'; $companyname = $this->input->post('company'); //echo $companyname; //$this->session->set_userdata($companyname); $this->session->set_userdata(array( 'company' => $companyname )); //$this->load->database($companyname, true); //print_r($this->session->userdata); //die; redirect('home'); }else{ $this->data['msg_class'] = 'gagal'; } } /*else if(isset()){ }*/ /////////////////////// $this->data['cookieremember'] = $this->input->cookie('remember'); $this->data['cookieusername'] = $this->input->cookie('username'); $this->data['cookiepassword'] = $this->input->cookie('userpass'); //echo $this->data['cookieremember'];echo $this->data['cookieusername']; echo $this->data['cookiepassword']; ////////////////////// $this->data['cookiename'] = $this->input->cookie('name', false); $this->data['cookieimage'] = $this->input->cookie('image', false); $sess_msg = $this->session->userdata('session_msg'); $session_msg_class = $this->session->userdata('session_msg_class'); if(isset($sess_msg) && $sess_msg!= ''){ $this->data['message']=$sess_msg; $this->data['msg_class'] = $session_msg_class!=''?$session_msg_class:'gagal'; } //render full layout, specific function $this->load->view('login', $this->data); } //////////////////////////////////////////////////////////////////////////////// function forgot_password(){ $this->load->view('send_reset_link', $this->data); } function send_pass_reset_link(){ $post_array=$this->input->post(); if($post_array['email']!='') { $email_id=$post_array['email']; $user_id=$this->mod_common->get_userid($post_array['email']); foreach($user_id $key){ $id=$key['id']; } if($id>0){ $link=base_url().'login/reset_password/'.$id; $message_body="<table> <tr><td style='padding:10px 0px'>dear user,</td></tr> <tr><td style='padding:10px 0px'>you have received communication in response request reset online portal account password. please find below link reset password</td></tr> <tr ><td style='padding:10px 0px'><a href='".$link."' style='background:#86c337;text-decoration:none;padding:5px 10px;color:#fff'> reset password </a></td></tr> <tr ><td style='padding:10px 0px'>regards,<br>unfold</td></tr> </table>"; /*-------------------------*/ //sending pass reset mail $this->load->library('email'); $config['protocol'] = 'sendmail'; $config['mailpath'] = '/usr/sbin/sendmail'; $config['charset'] = 'iso-8859-1'; $config['wordwrap'] = true; $config['mailtype'] = 'html'; $this->email->initialize($config); $this->email->set_newline("\r\n"); $this->email->from("info@unfold.com","admin");//email id , name of sender $this->email->to($email_id); // email id of recipient $this->email->subject("reset password"); //the subject line $this->email->message($message_body); $this->email->send(); //$this->email->clear(); //show_error($this->email->print_debugger()); //die; /*-------------------------*/ $this->data['reset_link_msg']="an email password reset link has been sent mail address."; }else{ $this->data['reset_link_msg']="sorry! email entered not in our database."; } } else {$this->data['reset_link_msg'] = '';} $this->load->view('send_reset_link', $this->data); } function reset_password(){ if($this->input->post()){ $post_array=$this->input->post(); $this->data['reset_msg']=$this->mod_common->reset_password($post_array); $this->load->view('reset_password', $this->data); } if($this->uri->segment(3)!=''){ $this->data['id']=$this->uri->segment(3); $this->load->view('reset_password', $this->data); } else{ redirect('login'); } } // admin authentication ---------- } ?>
your .htaccess seems ok problem appache
please try run command:
Comments
Post a Comment