Domanda

Sto avendo un problema ottenere CodeIgniter a lavorare sul mio account di hosting condiviso. L'URL è http://test.tallgreentree.com . Non mi sta dando un errore di .php, ma è la visualizzazione di una pagina 404 per tutto quello che si digita nella barra degli indirizzi.

Ecco l'inizio del mio file 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";

Ci sono problemi noti quando si utilizza CodeIgniter con sottodomini? Che cosa potrebbe causare questo? Ho provato diverse configurazioni, ma nulla sembra funzionare per me. Ciò che le impostazioni del server devo controllare con il mio fornitore di hosting?

Grazie a tutti per il vostro tempo e di assistenza.

È stato utile?

Soluzione

cambia

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

a

$config['uri_protocol'] = "REQUEST_URI"

e vedere se questo risolve esso

Inoltre, avete il nome del controller di classe lo stesso del nome del file?

nomefile = test.php

class Test ...

Altri suggerimenti

Fare 2 Variazioni file config.php

Il primo è:

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

a

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

Secondo uno è:

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

a

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

ho ottenuto questo lavoro con "REQUEST_URI", ma allora posso solo colpire la mia home page. Tutti gli altri collegamenti (al controllore) aggiorna sempre alla home page. È un po 'strano che mostra l'URL corretto, ma vi porta alla home page non importa ciò che si fa clic su URL.

Tutte le idee? Ho un file .htaccess,

RewriteEngine su 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 | Immagini | captcha | css | JS | robots.txt)! AddType text / css css

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top