我已经为此苦苦挣扎了几个小时: 我在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/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>我阅读了此文档: github/bcit -ci/CodeIgniter/wiki/Godaddy安装提示 但这也无济于事.也许是因为我的ci应用程序在子文件夹中?
I read this doc: github/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
发布评论