【发布时间】:2020-03-23 11:30:33
【问题描述】:
我在.htaccess 上提交了此代码
RewriteRule ^([0-9A-ZA-Z-]+)$ details.php?pro_id=$1 [QSA,NC,L]
当我访问localhost/index.php 并打开任何产品显示示例localhost/product-1 时,该产品就会显示。但是当我在localhost/country/city/place/product-1 中添加产品时,我找不到页面。如何重写 .htaccess 代码。在details.php 页面上为显示的产品信息编写代码。
所以我有这个:
localhost/index.php - localhost/product-url
我需要这个:
localhost/index.php - localhost/country/city/place/product-1`.
注意:在某些情况下,我将有 2 个类别,在某些情况下为 3。
【问题讨论】: