我有州列表和一个 php 文件,它将列出该州的所有城市。通过将 URL 参数作为/common.php/?state=Texas并列出所有城市。单击城市后,它会将 url 作为/common.php/?city=Alanreed&state_code=TX并显示城市信息。
我想使用 .htaccess 格式化 url,就像它应该采用的状态state_name.html eg. Texas.html和城市名称一样,Texas/sugar_land.html或者tx/sugar_land.html我如何使用 php 和 .htaccess 来实现这一点?