.htaccess内容目录重写
我在“内容”目录中有 php 文件,如下所示:
/wwwroot/content/about_us.php
还可能有子目录:
/wwwroot/content/team/team_bios.php
,我想在用户点击如下网址时向用户显示这些文件:
www.mydomain.com/about_us.php (/wwwroot/content/about_us.php) www.mydomain.com/team/team_bios.php (/wwwroot/content/team/team_bios.php)
I have php files in a 'content' directory like this:
/wwwroot/content/about_us.php
There could also be sub directories:
/wwwroot/content/team/team_bios.php
Using .htaccess, I want to show the user these files when they hit urls like this:
www.mydomain.com/about_us.php (/wwwroot/content/about_us.php)
www.mydomain.com/team/team_bios.php (/wwwroot/content/team/team_bios.php)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
将以下内容添加到站点
wwwroot
目录中的.htaccess
文件中。Add the following to the
.htaccess
file in thewwwroot
directory of your site.制定域的路由
/wwwroot/content/
。这样就会达到你想要的效果Make the route of the domain
/wwwroot/content/
. This will have the effect you desire使用.htaccess:
Using .htaccess: