[英]Ubuntu 14.04 can't find files
I am using Codeigniter 3 and setup a virtualbox using Puphpet. 我正在使用Codeigniter 3,并使用Puphpet设置了一个virtualbox。 I am usgin Ubuntu 14.04 and Apache2.
我正在使用Ubuntu 14.04和Apache2。 I have finally successfully been able to access my default controller route when I go to http://ip_address/ , but when I try to access another page it says Not Found.
当我转到http:// ip_address /时 ,我终于能够成功访问默认的控制器路由,但是当我尝试访问另一个页面时,它显示“未找到”。
I have my shared folder mounted to /var/www. 我将共享文件夹安装到/ var / www。 I have also verified that all of my files are located here.
我还验证了我的所有文件都位于此处。
Any idea why the default controller loads, but says not found for the other pages? 知道为什么默认控制器会加载,但对其他页面却找不到吗?
EDIT: the .htaccess file is located in the root folder (/var/www) this is the contents of the .htaccess file: 编辑:.htaccess文件位于根文件夹(/ var / www)中,这是.htaccess文件的内容:
# MAKE SURE TO LEAVE THE NEXT TWO LINES HERE.
# BEGIN DENY LIST --
# END DENY LIST --
RewriteEngine on
RewriteBase /
RewriteCond $1 !^(index.php|resources|robots.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
AllowOveride All
I have also made changes to /etc/apache2/sites-available/10-default_vhost_80.conf
and /etc/apache2/sites-available/25-av_fv5lzxiyh2xc.conf
我还对
/etc/apache2/sites-available/10-default_vhost_80.conf
和/etc/apache2/sites-available/25-av_fv5lzxiyh2xc.conf
进行了更改
<Directory "/var/www">
Options Indexes FollowSymlinks MultiViews
AllowOverride All
Require all granted
<FilesMatch "\.php$">
Require all granted
SetHandler proxy:fcgi://127.0.0.1:9000
</FilesMatch>
</Directory>dexes FollowSymlinks MultiViews
UPDATE: If I enter my url like http://ip_address/index.php/login
the page is found if I enter my url like http://ip_address/login
the page is not found. 更新:如果我输入
http://ip_address/index.php/login
之类的URL,则找到该页面;如果我输入http://ip_address/login
之类的URL,则该页面未找到。
I got it working by editing the default config file here: 我通过在这里编辑默认配置文件来使其工作:
/etc/apache2/sites-available/000-default.conf
And I added this to the default config: 我将其添加到默认配置中:
<Directory /var/www>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.