douce1368 2014-09-30 10:31
浏览 49
已采纳

mod重写 - 没有扩展名的img路径

I am using mod rewrite to strip URL of the .php extension, but the client wants me to go even further and strip of extensions all src paths in <img>. Is this doable via .htaccess, or maybe php? The only way I can think of now is JS but he wants it server side.

  • 写回答

1条回答 默认 最新

  • duanmanmian7589 2014-09-30 10:51
    关注

    Add a .htaccess file with the following line:

    Options +MultiViews
    

    Then you can access the files within a directory without the extension, as long as your filenames are unique it should work OK.

    The .htaccess file should be placed at the lowest level within your file structure that you want this behaviour to occur.

    This will work for all extension!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 ADS生成的微带线为什么是蓝色空心的
  • ¥15 求一下解题思路,完全不懂
  • ¥15 tensorflow
  • ¥15 densenet网络结构中,特征以cat方式复用后是怎么进行误差回传的
  • ¥15 STM32G471芯片spi设置了8位,总是发送16位
  • ¥15 R语言并行计算beta-NTI中tree文件的类型
  • ¥15 如何解读marsbar导出的ROI数据?
  • ¥20 求友友协助弄一下基于STC89C52单片机的声光控制灯原理图
  • ¥15 arduino双向交通灯设计
  • ¥15 有没有会粒子群算法的大能(○゜ε^○)求带不会出收敛图😭