【发布时间】:2021-08-17 08:24:13
【问题描述】:
我想在 htaccess 的帮助下重写 mysite 的 url。我需要重写的网站网址如下所示。 http://getallfreedownloads.com/category.php?slug=business_directory_listing
需要结果 http://getallfreedownloads.com/business_directory_listing 或 http://getallfreedownloads.com/business_directory_listing/
我在我的 htaccess 文件中使用了下面的代码来重写规则
RewriteEngine On
RewriteRule ^([^/]*)$ /category.php?slug=$1 [L]
请指导我如何使其正常工作。
注意:添加重写规则后,我从 a 标签中删除了 " category.php?slug="
我会非常感谢你们。
【问题讨论】: