簡體   English   中英

從ubantu14.04中的codeigniter-3中的URL刪除index.php

[英]Remove index.php from url in codeigniter-3 in ubantu14.04

我也有Ubantu 14.04機器,我也檢查了鏈接

我的phpinfo()說rewrite_module是Enable,我也已經對config.php進行了更改

$ config ['index_page'] ='';

以下是我的.htaccess文件在根目錄下

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

試試這個吧

Options +FollowSymLinks
IndexIgnore */*
# Turn on the RewriteEngine
RewriteEngine On
#  Rules
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php

我剛添加解決方案

<Directory /var/www/html >
   Order allow,deny
   AllowOverride All
   Allow from all
   Require all granted 
 </Directory> 

到文件/etc/apache2/sites-available/000-default.conf中,並且工作正常

暫無
暫無

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

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