Coder Social home page Coder Social logo

不支持url中index.php访问? about biny HOT 5 CLOSED

tencent avatar tencent commented on May 1, 2024
不支持url中index.php访问?

from biny.

Comments (5)

billge1205 avatar billge1205 commented on May 1, 2024

Biny 中并没有对 index.php做特殊处理 也就是说domain/index.php中的index.php会被认为是路由的一部分
程序会去查找index.phpAction 当然因为PHP的命名限制是肯定会报错的
不过框架这边的确应该对index.php 进行特殊处理一下
谢谢你的建议 请关注后续更新

from biny.

aloncn avatar aloncn commented on May 1, 2024

是的。在getRouterInfo里过滤下就支持了

from biny.

billge1205 avatar billge1205 commented on May 1, 2024

已更新 同时修复了无动态字段的重写逻辑(routeRule) 无法生效的问题

from biny.

aloncn avatar aloncn commented on May 1, 2024

@billge1205 我更新了你修复的,貌似不行
Fatal error: Action[index.phpAction] is not exists

我之前做法比较简单,直接在getRouterInfo里过滤下index.php

$_SERVER['REQUEST_URI'] = str_replace("/index.php","",$_SERVER['REQUEST_URI']);

from biny.

billge1205 avatar billge1205 commented on May 1, 2024

我这边只替换了 REQUEST_URI 中最后面的 ‘index.php‘ 如果是中间的话 我这边不做替换
if (substr($pathRoot, -9) === 'index.php'){ $pathRoot = substr($pathRoot, 0, -9); }

from biny.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.