Ich habe zwei Projekte mit unterschiedlicher Version von Code Igniter. Das erste Projekt ist auf CI 2.0.2 und das andere auf CI 3.0. Wenn ich das 3.0-Projekt auf meinem Computer implementiere, fehlt der Projektname in der Adressleiste.Wie behebt man den Versionsunterschied des Code-Zünders?
Beispiel:
, wenn ich das Projekt zum ersten Mal öffnen, ist die Adresse 'http://localhost:8080/bsm/'
. Aber wenn ich auf die Login-Schaltfläche klicke, um das Anmeldeformular zu öffnen, wird die Adresse 'http://localhost:8080/login'
. Es sollte 'http://localhost:8080/bsm/login/'
sein.
Ich habe kein Problem mit dem 2.0.2-Projekt. Also, wie wird die Adressleiste des 3.0-Projekts korrekt angezeigt?
Update:
- Mein base_url ist
$config['base_url']= "http://localhost:8080/bsm/";
- ich mein Anker bemerken
<a href='/login'>Login</a>
ist. Wenn ich es zuhref='bsm/login'
ändere, wird die Adresse'http://localhost:8080/bsm/bsm/login/'
. - Meine .htaccess
<IfModule mod_rewrite.c> RewriteEngine On # !IMPORTANT! Set your RewriteBase here and don't forget trailing and leading # slashes. # If your page resides at # http://www.example.com/mypage/test1 # then use # RewriteBase /mypage/test1/ RewriteBase/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /bsm/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>
I '$ config [ 'base_url'] =" http: // localhost: 8080/bsm/";' – Vahn
@Vahn hat meine Antwort aktualisiert –
Es funktioniert immer noch nicht. Bitte siehe Update – Vahn