简体   繁体   English

CodeIgniter | .htaccess从网址Mac OS优胜美地删除index.php

[英]CodeIgniter | .htaccess removing index.php from url Mac os yosemite

I'm having problem removing index.php from url.. I've tried a lot of google tips and no success. 我在从网址中删除index.php遇到问题。我尝试了很多Google提示,但均未成功。 I'm using mac os x yosemite, php 5.5.0 and Apache 2.4.10. 我正在使用Mac OS X优胜美地,PHP 5.5.0和Apache 2.4.10。 Please, does any one nows what happenning? 拜托,现在有人发生了什么吗?

.htaccess .htaccess

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

config.php config.php

$config['base_url'] ='http://localhost/~veniciobr/iTicket';
$config['index_page'] = '';

Don't forget the rewrite base : 不要忘记重写基础:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /~veniciobr/iTicket/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

Restart Apache and check also if your mod_rewrite extension is enabled. 重新启动Apache,并检查是否启用了mod_rewrite扩展名。

This Worked for me 这对我有用

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM