Welcome Guest, Not a member yet? Register   Sign In
htaccess redirect problem with 404 Page Not Found
#1

[eluser]icebergdelphi[/eluser]
Hi all, I have some problem with my new proyect using CI ver 2.1.2, I want to use a clear Url access with no index.php/....

OS:WindowsXP
xampp-win32-1.7.7-VC9

Problem:
The problem is when i click in my Login project page, the browser rise:,checkloging 404 not found
checklogin is a controller to check if the user validations,but the .htacess not redirect to my checklogin file.

But if i do the next:
http:localhost/Vilab/index.php/checklogin
everything works fine.
NOTE:
I've been finished, another project with the same config, and i have not problem.
The next configs, i've used in another project, and this runs with no problem:

I have configured all this things:

1.-I created a .htaccess file inside my root folder proyect:C:/xammp/htdocs/ViLab
Note:ViLab is the Name of my CI Folder, i've renamed to ViLab
Code:
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteBase /ViLab

#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#‘system’ can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ index.php/$1 [L]

#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn’t true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#This last condition enables access to the images and css folders, and the robots.txt file
#Submitted by Michael Radlmaier (mradlmaier)
RewriteCond $1 !^(index\.php|images|robots\.txt|css)
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
# If we don’t have mod_rewrite installed, all 404’s
# can be sent to index.php, and everything works as normal.
# Submitted by: ElliotHaughin

ErrorDocument 404 /index.php
</IfModule>

2.- I overwrite the next line in config folder:
Code:
$config['index_page'] = '';

3.- In Apache httpd.conf, i have:LoadModule rewrite_module modules/mod_rewrite.so
Code:
#LoadModule proxy_http_module modules/mod_proxy_http.so
   LoadModule rewrite_module modules/mod_rewrite.so
   LoadModule setenvif_module modules/mod_setenvif.so
#LoadModule speling_module modules/mod_speling.so

4.-My route.php config:
Code:
$route['default_controller'] = "login";

The Problem:
I just run my web app and this shows me my login page, 'til here everythings is ok, this is my login page code:
Code:
&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Login extends CI_Controller {

  function __construct()
  {
    parent::__construct();
$this->load->helper('url');
  }

  function index()
  {
    $this->load->helper('form');
    $this->load->view('login_view');
  }

}

?&gt;

and my Login_view code, with a &lt;?php echo form_open('checklogin'); ?&gt; to call my controller:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt;
&lt;title&gt;Acceso al Sistema de Laboratorios de Analisis Clinicos&lt;/title&gt;
&lt;link rel="stylesheet" type="text/css" href="&lt;?=base_url()?&gt;resources/css/login-box.css"/&gt;
&lt;/head&gt;


&lt;body&gt;
  &lt;body background="&lt;?=base_url()?&gt;resources/image/bg4.jpg" &gt;

<div>
<div id="login-box">

<H2>Acceso</H2>

&lt;?php echo validation_errors(); ?&gt;
&lt;?php echo form_open('checklogin'); ?&gt;


<br />
<br />
<div id="login-box-name">Usuario:</div><div id="login-box-field">input name="Nick" class="form-login" title="Usuario" value="" size="30" maxlength="2048" /></div>
<div id="login-box-name">Password:</div><div id="login-box-field">&lt;input name="Password" type="password" class="form-login" title="Password" value="" size="30" maxlength="2048" /&gt;&lt;/div>
<p class="submit">
   &lt;input type="submit" name="login-boton" id="login-boton"  tabindex="100" value='' /&gt;
    &lt;input type="hidden" name="testcookie" value="1" /&gt;
</p>
<br />

<br />
<br />

</div>

</div>

&lt;/body&gt;
&lt;/html&gt;

So what is the problem, in my other project works so fine , but in my new project, rise error 404.

Thanks to all, i hope you can help me.
#2

[eluser]icebergdelphi[/eluser]
Smile I just reinstall Xammp and all works perfectly, thanks to all.




Theme © iAndrew 2016 - Forum software by © MyBB