【发布时间】:2017-10-11 19:21:39
【问题描述】:
我们在 ec2 上有一台 ubuntu 机器作为服务器,默认的 /var/www/html 有一个指向 /home/ubuntu 的符号链接
ubuntu@ip-172-XX-XX-XXX:/var/www/html$ ls -al
total 20
drwxrwxrwx 2 root root 4096 Sep 10 02:19 .
drwxr-xr-x 3 root root 4096 Sep 10 02:17 ..
-rw-r--r-- 1 root root 11321 Sep 10 02:17 index.html
lrwxrwxrwx 1 root root 20 Sep 10 02:19 website -> /home/ubuntu/website
目录/home/ubuntu/website 包含
public_html/app/
这是 CodeIgniter 的家(基地)。当我访问网站时
http://ec2-34-XXX-XX-XXX.compute-1.amazonaws.com/website/public_html/app/index.php/login
我可以看到页面加载正确。但是当我以
身份访问它时http://ec2-34-XXX-XX-XXX.compute-1.amazonaws.com/website/public_html/app/login
我不能 - 它显示
Not Found
The requested URL /website/public_html/app/login was not found on this server.
.htaccess 文件如下:
RewriteEngine on
RewriteBase /website/public_html/app/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /website/public_html/app/index.php/$1 [L]
我在这里缺少什么? (Mod 重写已启用。)
【问题讨论】:
-
.htaccess 文件在
/website/public_html/app/? -
是的,感谢问题现已解决!
标签: php apache .htaccess codeigniter