CodeIgniter删除子目录中的index.php

发布于 2024-10-03 21:50:42 字数 217 浏览 0 评论 0原文

我正在尝试从托管在子域“test”内的 codeigniter 项目中的 url 中删除 index.php

我已经尝试了以下 .htaccess,但出现内部服务器错误。

RewriteEngine On 
RewriteBase /test
RewriteRule ^(.*)$ /index.php/$1 [L]

谁能看到问题,谢谢

I'm trying to remove the index.php from the url in a codeigniter project thats hosted inside a subdomain 'test'

I've tried the following .htaccess, but I'm getting an internal server error.

RewriteEngine On 
RewriteBase /test
RewriteRule ^(.*)$ /index.php/$1 [L]

can anyone see the problem, thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

鸢与 2024-10-10 21:50:42

我用这个...应该也适用于子文件夹,我想..

RewriteEngine on
RewriteCond $1 !^(index\.php|public|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA] 

I use this... should work on a subdfolder as well, I think..

RewriteEngine on
RewriteCond $1 !^(index\.php|public|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA] 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文