为分层类别编写 .htaccess mod 重写
我需要重写我的分类广告目录的网址
我有 4 种类型的链接
/City ==>显示城市/City/Cat1中的所有广告
==> 中的所有广告
显示城市 + 类别/City/Cat1/Cat2 ==> 显示在城市 + 类别 1 + 类别 2 中添加广告
/City/Cat1/Cat2/Ad-id ==>显示广告本身并传递 cat1 cat2 和 city 变量
原始隐藏网址应为 index.php?city=alexandria&cat1=cars&cat2=bikes&adid=EWSw22d
你能帮我吗为此结构编写.htaccess
i need to rewrite urls for my classified ads directory
i have 4 types of links
/City ==> display all ads in city
/City/Cat1 ==> display all ads in city + category
/City/Cat1/Cat2 ==> display add ads in city + category 1 + category 2
/City/Cat1/Cat2/Ad-id ==> display the ad itself and pass cat1 cat2 and city variables
original hidden url should be index.php?city=alexandria&cat1=cars&cat2=bikes&adid=EWSw22d
Can you please help me writing .htaccess for this structure
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可能应该将第一个重写规则替换为 rewritecond,但想法是这样的:
You should probably replace the first rewrite rule for a rewritecond, but this is the idea:
我将使用单个规则将所有不存在的请求恢复到索引 PHP,然后解析那里的请求字符串。像这样
I'd make it with single rule to revert all unexisting requests to the index PHP and then parse the request string there. Smth like this