Apache htaccess vhost codeigniter index.php
我读了很多关于同一问题的话题,但我没有找到解决办法。。。请帮帮我。我有一个灯进入ubuntu服务器。我的文档根目录是/home/utete/我有另一个目录(turni)和codeigniter web应用程序。这个web应用程序可以很好地将“index.php”添加到url中,但我想消除它。我有以下配置: 将config.php导入codeigniter:Apache htaccess vhost codeigniter index.php,apache,.htaccess,codeigniter,ubuntu,Apache,.htaccess,Codeigniter,Ubuntu,我读了很多关于同一问题的话题,但我没有找到解决办法。。。请帮帮我。我有一个灯进入ubuntu服务器。我的文档根目录是/home/utete/我有另一个目录(turni)和codeigniter web应用程序。这个web应用程序可以很好地将“index.php”添加到url中,但我想消除它。我有以下配置: 将config.php导入codeigniter: $config['index_page'] = ''; .htaccess: RewriteEngine On RewriteBase /
$config['index_page'] = '';
.htaccess:
RewriteEngine On
RewriteBase /
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]
/etc/apache2/可用站点/默认值:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /home/utente
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/utente/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
服务器管理员webmaster@localhost
DocumentRoot/home/utete
选项如下符号链接
不允许超限
选项索引跟随符号链接多视图
不允许超限
命令允许,拒绝
通融
ScriptAlias/cgi-bin//usr/lib/cgi-bin/
不允许超限
选项+执行CGI-多视图+符号链接所有者匹配
命令允许,拒绝
通融
ErrorLog${APACHE_LOG_DIR}/error.LOG
#可能的值包括:调试、信息、通知、警告、错误、临界值、,
#警惕,埃默格。
日志级别警告
CustomLog${APACHE\u LOG\u DIR}/access.LOG组合
别名/doc/“/usr/share/doc/”
选项索引多视图跟随符号链接
不允许超限
命令拒绝,允许
全盘否定
允许从127.0.0.0/255.0.0.0::1/128开始
当我打开web应用程序的链接,将eh“index.php”插入到url中时,服务器提示了以下错误:在该服务器上找不到请求的url/turni/auth/login
为什么???如果我把index.php放在/turni/index.php/auth/login这样的位置,那么一切都很好。。。。
感谢您的帮助并为我的英文版感到抱歉:D将.htaccess添加到您的服务器根目录,并将重写基更改为
RewriteBase /turni
假设您的codeigniter出现在/var/www/turni中,谢谢您的回复!我试过了,但没有任何改变:(我的codeigniter出现在/home/utete/turni/任何其他解决方案中?)??