【发布时间】:2017-09-18 11:00:38
【问题描述】:
大家好,我用 PHP 制作了这个应用程序,不同的页面相互链接在一起。该应用程序运行良好,但生成的 URL 非常混乱和复杂。我的应用程序中有三个页面,即
1.index.php (the default file)
2.video.php (the category page)
3.video-detail.php(the page for playing the video)
并且根文件夹的名字是april
现在为应用程序生成的链接是。
http://localhost/april/video?cat_id=2&category=Programming-Language
考虑到我在第一页中从用户那里获取一些输入后正在浏览某个类别的第二页。现在我正在尝试 URL 应该比这更干净。例如:URL 应该是这种格式。
http://localhost/april/Programming-Language.
我知道这项任务是使用 .htacess 完成的,但我无法真正理解它的方法。因此,我们非常感谢有关此主题的任何帮助。
【问题讨论】:
-
你使用的是哪个框架?
-
只是基本的 PHP。连同 apache 服务器。
-
你必须在 .htaccess 中开启 RewriteEngine
标签: php html .htaccess url web