Godaddy中的Codeigniter .htaccess

编程入门 行业动态 更新时间:2024-10-08 23:01:43
本文介绍了Godaddy中的Codeigniter .htaccess的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已经为此苦苦挣扎了几个小时: 我在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

本文发布于:2023-11-02 06:11:58,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1551587.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Godaddy   Codeigniter   htaccess

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!