簡體   English   中英

刪除index.php codeigniter

[英]remove index.php codeigniter

我真的找不到辦法讓我的.htaccess工作,並從我的localhost網站的網址中刪除/index.php/部分: http://localhost/ci_intro/index.php/home/

來自XAMPP / xamppfiles / htdocs / ci_intro / application / config / routes.php

$route['default_controller'] = 'home';
$route['404_override'] = '';

來自XAMPP / xamppfiles / htdocs / ci_intro / application / config / config.php

$config['base_url'] = 'http://localhost/ci_intro/';
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';

來自XAMPP / xamppfiles / etc / httpd.conf

LoadModule rewrite_module modules/mod_rewrite.so

 ...

<Directory "/Applications/XAMPP/xamppfiles/htdocs">
    Options Indexes FollowSymLinks ExecCGI Includes
    AllowOverride All
    Require all granted
</Directory>

mod_rewrite.so正在工作,我用phpinfo()檢查了它...

來自XAMPP / xamppfiles / htdocs / ci_intro / .htaccess

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /ci_intro/

    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]

    RewriteCond %{REQUEST_URI} ^application.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]

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

<IfModule !mod_rewrite.c>
    ErrorDocument 404 /index.php
</IfModule>

有任何想法嗎? 拜托,我真的需要幫助,謝謝!

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

在你的htaccess中寫這個
檢查此鏈接以啟用apache設置的 mod_rewrite功能

我的猜測是你沒有在httpd.conf / apache2.conf中為你的DocumentRoot對象設置“AllowOverride All”

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM