dtpyvb1873 2015-10-07 20:27
浏览 17

Php,通过htaccess或Explode数组URL重写URL

This is my first question around here, so I'll try to be descriptive and everything.

Basically, I want to make a directory structre URL, Like accessories/watch/gold.

Now, I got three $_GET variables in my file, one for the accessories one for the watch and one for the color.

How can I make a rewrite that I will be able to get into the page just with accessories OR accessories/watch? It's all via the same FILE. Now, I have tried exploding the URL since i didn't knew how to make this regExp.

But, when I explode the URL I can INSERT as many slashes as I want into the url like this accessories////////watch////gold//, and I want with each word just one slash.

When I tried rewriting, basically it requried all three variables, and one time it didn't but made all the others just empty. I don't want them to be isset. Thanks!

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 Oracle中如何从clob类型截取特定字符串后面的字符
    • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
    • ¥15 如何在炒股软件中,爬到我想看的日k线
    • ¥15 seatunnel 怎么配置Elasticsearch
    • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
    • ¥15 (标签-MATLAB|关键词-多址)
    • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
    • ¥500 52810做蓝牙接受端
    • ¥15 基于PLC的三轴机械手程序
    • ¥15 多址通信方式的抗噪声性能和系统容量对比