Pregunta

Estoy teniendo problemas para conseguir CodeIgniter para trabajar en mi cuenta de alojamiento compartido. La URL es http://test.tallgreentree.com . No me da un error de php, pero está mostrando una página 404 para todo lo que se teclea en la barra de direcciones.

Esto es el comienzo de mi archivo config.php.

<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
|   http://example.com/
|
*/
$config['base_url'] = "http://test.tallgreentree.com/";

/*
|--------------------------------------------------------------------------
| Index File
|--------------------------------------------------------------------------
|
| Typically this will be your index.php file, unless you've renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
*/
$config['index_page'] = "index.php";

/*
|--------------------------------------------------------------------------
| URI PROTOCOL
|--------------------------------------------------------------------------
|
| This item determines which server global should be used to retrieve the
| URI string.  The default setting of "AUTO" works for most servers.
| If your links do not seem to work, try one of the other delicious flavors:
|
| 'AUTO'            Default - auto detects
| 'PATH_INFO'       Uses the PATH_INFO
| 'QUERY_STRING'    Uses the QUERY_STRING
| 'REQUEST_URI'     Uses the REQUEST_URI
| 'ORIG_PATH_INFO'  Uses the ORIG_PATH_INFO
|
*/
$config['uri_protocol'] = "AUTO";

¿Hay problemas conocidos cuando se utiliza con CodeIgniter subdominios? Lo que podría ser la causa de esto? He probado varias configuraciones, pero nada parece estar funcionando para mí. ¿Qué configuración del servidor debería consultar con mi proveedor de alojamiento?

Gracias a todos por su tiempo y ayuda.

¿Fue útil?

Solución

cambio

$config['uri_protocol'] = "AUTO";

a

$config['uri_protocol'] = "REQUEST_URI"

y ver si se soluciona el problema

También, ¿tiene el nombre del controlador de clase el mismo que el nombre del archivo?

filename = test.php

class Test ...

Otros consejos

Hacer 2 Cambios en el archivo config.php

El primero es:

   `$config['uri_protocol'] = "AUTO";`

a

   `$config['uri_protocol'] = "REQUEST_URI"`

En segundo lugar uno es:

    $config['index_page'] = 'index.php';

a

    $config['index_page'] = 'index.php?';

Tengo esta trabajando con "REQUEST_URI", pero entonces sólo puedo golpear a mi página de inicio. Todos los demás enlaces (en el controlador) siempre refresca a la página principal. Es un poco raro que muestra la URL correcta, pero le lleva a la página de inicio no importa qué URL se hace clic.

¿Alguna idea? Tengo un archivo .htaccess,

RewriteEngine en RewriteBase / testci RewriteCond% {} ^ REQUEST_URI sistema. * RewriteRule ^ (. ) $ /index.php/$1 [L] RewriteCond% {} REQUEST_FILENAME! -F RewriteCond% {} REQUEST_FILENAME! -D RewriteRule ^ (. ) $ index.php / $ 1 [L] RewriteCond $ 1 ^ (index.php | imágenes | código de imagen | css | JS | robots.txt)! AddType text / css Css

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top