【发布时间】:2015-07-09 13:05:07
【问题描述】:
我正在使用 FTP 将 codeigniter 网站上传到服务器。我将 FTP 中的文件安排如下(我没有 10 个):
index.php 查找系统和应用程序文件夹。但我不知道如何处理 .htaccess 文件。我尝试了网络上的各种示例,这里有一个示例:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?example.com$
RewriteCond %{REQUEST_URI} !^/public_html/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /public_html/$1
RewriteCond %{HTTP_HOST} ^(www.)?example.com$
RewriteRule ^(/)?$ public_html/index.php [L]
这是我第一次使用 codeigniter,这个问题可能很愚蠢(对不起)。我真的很感谢我能得到的所有帮助。
我现在有另一个 .htaccess 文件,它从 url 中删除了 index.php:
RewriteEngine On
RewriteBase /example.com/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
【问题讨论】:
-
你在
index.php中定义了正确的路径吗? -
是的,这不是问题 :)
标签: php .htaccess codeigniter ftp