在Ubuntu codeigniter问题 [英] Problems with codeigniter on ubuntu
问题描述
我有在Ubuntu 10(LAMP)codeigniter。我有一个htaccess文件:
I’ve got Codeigniter on Ubuntu 10 (LAMP). I have an htaccess file:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /dort
#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php
#controller, previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /dort/index.php?/$1 [L]
#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends
#the request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /dort/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>
到现在为止,我们连接远程服务器的IP地址,我的基站坐在一个名为文件夹下
多特',所以我们习惯叫它像这样:的http:// some_ip /多特
现在,我们映射了一个虚拟主机多特,所以我们把它像: http://demo.dort.com/ 突然什么
now we mapped a virtual host to dort, so we call it like: http://demo.dort.com/ and suddenly nothing
工作除了登录页面(的index.php)。我已经改变了$配置['BASE_URL']在config.php但我
works except for the login page (index.php). I’ve changed $config[‘base_url’] in config.php but i
继续得到404
请帮助:(
推荐答案
你使用虚拟主机?
我有同样的问题,这个解决
I have same problem and solve with this
1)让虚拟主机在我的情况是这样的:文件/ etc / apache2的/网站的可用/默认
1) Make virtual host in my case is like this: file /etc/apache2/sites-available/default
<VirtualHost *:80>
ServerAdmin admin@email.com
DocumentRoot /var/www/dort
ServerName yourdomain.biz #this domain must be define tld info.
ErrorLog /var/log/apache2/error_2.log
<Directory /var/www/dort>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
# Uncomment this directive is you want to see apache2's
# default start page (in /apache2-default) when you go to /
#RedirectMatch ^/$ /apache2-default/
</Directory>
</VirtualHost>
2)的文件/ etc / hosts中设置主机
2) Setting host in file /etc/hosts
127.0.0.1 localhost
127.0.0.1 yourdomain.biz
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
3)的.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# Send admin URL's to the admin controller (then skips the rest of the redirect rules)
RewriteCond %{REQUEST_URI} ^/admin(.*)
RewriteRule ^(.*)$ /index.php/admin/$1 [L]
# Redirects any request thats not a file or directory through to the main controller
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/main/$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.
ErrorDocument 404 /index.php
</IfModule>
4)确保在重启Apache不显示误差
4) Make sure when restart apache not show error
Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
5)进入浏览并运行此网址 http://yourdomain.biz
这篇关于在Ubuntu codeigniter问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!