Godaddy中的Codeigniter .htaccess [英] Codeigniter .htaccess in godaddy
问题描述
我已经为此苦苦挣扎了几个小时: 我在godaddy托管的子文件夹中有一个codeigniter应用程序,可以说:
I am struggling with this for hours now: I have a codeigniter application in a sub folder in a godaddy hosting, lets say:
mydomain.com/myfolder/myapp/
我有这个.htaccess:
I have this .htaccess:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /myfolder/myapp/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?$1 [L]
</IfModule>
我阅读了此文档: https://github.com/bcit -ci/CodeIgniter/wiki/Godaddy安装提示 但这也无济于事.也许是因为我的ci应用程序在子文件夹中?
I read this doc: https://github.com/bcit-ci/CodeIgniter/wiki/Godaddy-Installation-Tips but it won't help neither. Maybe because my ci app is in a subfolder?
如何隐藏index.php?并使其与友好的网址一起使用?
How can I hide the index.php? and make it work with friendly urls?
推荐答案
让您的/myfolder/myapp/.htaccess
像这样:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /myfolder/myapp/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>
然后在/myfolder/myapp/application/config/config.php
中,您需要进行以下配置:
then in /myfolder/myapp/application/config/config.php
you need to have this config:
$config['base_url'] = '';
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';
这篇关于Godaddy中的Codeigniter .htaccess的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!