dongwuwu6104 2014-01-24 01:47
浏览 45

需要htaccess知识

I've put on htaccess on xamp (I've used it before)

but trying to change the following

index.php?admin&user&list

to

example.com/admin/user/list

I have a few other pages behind /admin/. Do I need to make 1 for every page?

  • 写回答

1条回答 默认 最新

  • douxi3085 2014-01-24 02:01
    关注

    You can try:

    RewriteEngine On
    
    RewriteCond %{THE_REQUEST} \ /+index\.php\?
    RewriteCond %{QUERY_STRING} ^(.*)&(.*)$
    RewriteRule ^index\.php$ /index.php?%1/%2 [L,NE]
    
    RewriteCond %{THE_REQUEST} \ /+index\.php\?
    RewriteCond %{QUERY_STRING} !&
    RewriteRule ^index\.php$ /%{QUERY_STRING}? [L]
    

    This makes it so when you request http://example.com/index?abc&def&ghi, the rules will internally route the request to /abc/def/ghi

    评论

报告相同问题?

悬赏问题

  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥30 BC260Y用MQTT向阿里云发布主题消息一直错误
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)