codeIgniter - 放在哪里的.htaccess? [英] CodeIgniter - Where to put .htaccess?

查看:107
本文介绍了codeIgniter - 放在哪里的.htaccess?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我构建的应用程序和托管它GoDaddy的。但每次我访问该网页,它说:未指定输入文件。所以我搜索的解决方案,我发现我应该改变我的.htaccess文件,这个

I built an application and hosted it on GoDaddy. But everytime I access the page, it says "No input file specified". So I searched for solutions and found that I should change my .htaccess files to this

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

我没有在我的codeigniter目录中的一个真正的.htaccess文件。所有我发现是同一名称的文件,但它们含有所有拒绝。

I don't have a real .htaccess file in my codeigniter directory. All I found were files of the same name but they contained "Deny from all".

我所做的是我在记事本+ +复制code以上,并将其保存为'的.htaccess',那么我uploded到我的codeigniter应用程序的目录。但它并没有正常工作。

What I did was I copied the code above in notepad++ and saved it as '.htaccess', then I uploded it to my codeigniter app's directory. But it did not work.

那么,我把我的.htaccess文件?有什么建议?

So where do I put my .htaccess file? Any suggestions?

推荐答案

将它添加到您的网站的根目录下(或以codeigniter根)

Add it to the root of your website (or to the root of codeigniter)

结构示例:

  • /var/www/public_html/.htaccess
  • /var/www/public_html/index.php
  • /无功/网络/的public_html /系统
  • /无功/网络/的public_html /应用
  • ...

这篇关于codeIgniter - 放在哪里的.htaccess?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆