Apache 其中';codeigniter中的htaccess文件是什么?

Apache 其中';codeigniter中的htaccess文件是什么?,apache,codeigniter-url,Apache,Codeigniter Url,我想知道CodeIgniter是如何重写url的。默认情况下,还没有htaccess文件 它还能用吗 谢谢已经有一段时间了,但如果您不知道的话。htaccess是一个隐藏文件,它位于您的根文件夹中。。。 希望对您有所帮助一切都通过index.php路由。i、 e site.com/index.php/controller/method/arg 您将使用htaccess文件删除URL的“index.php”部分。i、 e RewriteCond %{REQUEST_URI} !^(/inde

我想知道CodeIgniter是如何重写url的。默认情况下,还没有htaccess文件 它还能用吗


谢谢

已经有一段时间了,但如果您不知道的话。htaccess是一个隐藏文件,它位于您的根文件夹中。。。
希望对您有所帮助

一切都通过index.php路由。i、 e

  site.com/index.php/controller/method/arg
您将使用htaccess文件删除URL的“index.php”部分。i、 e

RewriteCond %{REQUEST_URI} !^(/index\.php|/assets|/tmp|/robots\.txt|/crossdomain\.xml|/favicon\.ico)
RewriteRule ^(.*)$ /index.php/$1 [L]
这将为您提供“更漂亮”的URL,即

  site.com/controller/method/arg
但是,CI没有必要正确路由URL。根据您的apache配置,这通常仍将正确解析,并将请求切换到index.php,这反过来决定了“路径”为/controller/method/arg