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 SQL Server下载
  • ¥15 python如何将动态的多个子列表,拼接后进行集合的交集
  • ¥20 vitis-ai量化基于pytorch框架下的yolov5模型
  • ¥15 如何实现H5在QQ平台上的二次分享卡片效果?
  • ¥15 python爬取bilibili校园招聘网站
  • ¥30 求解达问题(有红包)
  • ¥15 请解包一个pak文件
  • ¥15 不同系统编译兼容问题
  • ¥100 三相直流充电模块对数字电源芯片在物理上它必须具备哪些功能和性能?
  • ¥30 数字电源对DSP芯片的具体要求