删除子目录和文件扩展名 [英] Remove sub directory and file extension
本文介绍了删除子目录和文件扩展名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我有site.com/page/about.php
If I have site.com/page/about.php
如何删除子目录和文件扩展名?
How can I remove the sub directory and file extension?
例:site.com/about
Example: site.com/about
推荐答案
在你的.htaccess文件使用此
Use this in your .htaccess file
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^about(\/?)$ /page/about.php [NC,L]
在你的根文件夹中创建你的.htaccess。
Create your .htaccess in your root folder.
这篇关于删除子目录和文件扩展名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文