2016-12-21 1 views
0

CodeIgniter in localhost funktioniert gut, aber wenn ich es an den Server weitergegeben werden nur die index Seite funktioniert.CodeIgniter arbeitet in localhost gut, aber wenn ich an den Server übergeben nur die Index-Seite arbeitet

Ich habe versucht, die config.php Wechsel durch Änderung:

  1. $config['uri_protocol'] = 'PATH_INFO'; zu $config['uri_protocol'] = 'REQUEST_URI'
  2. $config['index_page'] = 'index.php'; zu $config['index_page'] = 'index.php?';

Aber es ist immer noch nicht funktioniert.

config.php Datei:

$config['base_url'] = 'http://s661658794.onlinehome.fr/admin'; 
$config['index_page'] = 'index.php'; 
$config['uri_protocol'] = 'REQUEST_URI'; 

.htaccess Datei:

RewriteEngine on 
RewriteCond $1 !^(index\.php|resources|robots\.txt) 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php?/$1 [L,QSA] 

## EXPIRES CACHING ## 
<IfModule mod_expires.c> 
ExpiresActive On 
ExpiresByType image/jpg "access 1 year" 
ExpiresByType image/jpeg "access 1 year" 
ExpiresByType image/gif "access 1 year" 
ExpiresByType image/png "access 1 year" 
ExpiresByType text/css "access 1 year" 
</IfModule> 
## EXPIRES CACHING ## 


<ifModule mod_gzip.c> 
mod_gzip_on Yes 
mod_gzip_dechunk Yes 
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$ 
mod_gzip_item_include handler ^cgi-script$ 
mod_gzip_item_include mime ^text/.* 
mod_gzip_item_include mime ^application/x-javascript.* 
mod_gzip_item_exclude mime ^image/.* 
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.* 
</ifModule> 
<ifModule mod_headers.c> 
    Header set Connection keep-alive 
</ifModule> 


RewriteEngine on 
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] 
RewriteRule ^(.*)$ http://%1%{REQUEST_URI} [R=301,QSA,NC,L] 

`

+0

Beim Verlegen des anderen Seite geht: Fehler 404 - Nicht gefunden – fegugi

+0

Verwenden Sie Apache oder Nginx auf Ihrer Produktionsmaschine? Und/oder haben Sie installiert, welche Variante der URL Neuschreibung notwendig ist? – castis

+0

Der Server verwendet Apache, denke ich. – fegugi

Antwort

0

Haben Sie base_url geändert() in config.php

$config['base_url'] = 'http://demo.com/'; 

sollten Sie fügen Sie eine neue Datei .htaccess

RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} !-f 

RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php?/$1 [L] 

Sie müssen Datenbankeinstellung in database.php ändern und rückgängig machen alle oben genannten Änderungen, die Sie in Ihrer config.php getan

Verwandte Themen