doufu5401 2015-06-16 12:54
浏览 48

删除网址上的文件扩展名

Good day! Got a lot of questions here but i guess i can't ask it all at once so i'll start with the problem i am facing now. So, I am new to .htaccess and I don't know how or if it is possible to remove the file extensions on url, like for example I am accessing my home page in this url "www.sniper.com/home.php", so the question is clear. Is it really possible to use .htaccess to remove the file extension so that when you are at homepage the url will look just like "www.sniper.com/home" ?

  • 写回答

1条回答 默认 最新

  • duanboshe0001 2015-06-16 12:56
    关注

    To remove .php extension

        RewriteEngine On
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^([^\.]+)$ $1.php [NC,L]
    
    评论

报告相同问题?

悬赏问题

  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 关于#python#的问题:自动化测试