【发布时间】:2016-07-13 08:05:08
【问题描述】:
我正在开发 codeigniter 当我在 xampp 服务器上使用它时,它与这个 Url 配合得很好 localhost.com/realestate/index.php?class/method/parameter
但是当我把类似的东西放在godaddy主机上时
相同的 Url 段显示 codeigniter 404 错误
【问题讨论】:
标签: php codeigniter url
我正在开发 codeigniter 当我在 xampp 服务器上使用它时,它与这个 Url 配合得很好 localhost.com/realestate/index.php?class/method/parameter
但是当我把类似的东西放在godaddy主机上时
相同的 Url 段显示 codeigniter 404 错误
【问题讨论】:
标签: php codeigniter url
为您的文件夹添加.htaccess。 Here is some result Check it out all the links.
主机区分大小写,因此在命名控制器和模型名称时也要小心
【讨论】:
DirectoryIndex index.php index.html
<IfModule mod_rewrite.c>
RewriteEngine On
# RewriteBase /yourfoler/
RewriteCond $1 !^(index\.php|assets|install|update)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# For godady Shared Hosting Server uncomment the line below
RewriteRule ^(.*)$ index.php?/$1 [L]
# Please comment this if you have uncommented the above
# RewriteRule ^(.*)$ index.php/$1 [NC,L,QSA]
</IfModule>
localhost.com/realestate/index.php?class/method/parameter 可以代替这个 localhost.com/realestate/class/method/parameterrun 像这样使用下面的 htaacess
【讨论】: