如何通过htaccess从Url中隐藏index.php

发布于 2024-09-27 09:25:37 字数 65 浏览 0 评论 0原文

关于 Code Igniter 和 MySql:
如何通过htaccess从Url中隐藏index.php?

With respect to Code Igniter And MySql:
How to hide index.php from Url by htaccess?

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

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

发布评论

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

评论(1

慕巷 2024-10-04 09:25:37

请参阅 CodeIgniter 手册

在文档根目录中,.htaccess 文件包含以下内容:

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt) # these are examples,
                                                 # add everything here that
                                                 # you **don't** want to be
                                                 # routed to CI
RewriteRule ^(.*)$ /index.php/$1 [L]

然后在 application/config/config.php 中更改:

$config['index_page'] = '';

See the CodeIgniter Manual.

In your document root, a .htaccess file containing the following:

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt) # these are examples,
                                                 # add everything here that
                                                 # you **don't** want to be
                                                 # routed to CI
RewriteRule ^(.*)$ /index.php/$1 [L]

Then in application/config/config.php change:

$config['index_page'] = '';
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文