duanchen7703 2018-11-08 18:04
浏览 126
已采纳

$ _GET抛出403

I have a simple custom MVC app using $_GET to parse a url, and i've got it working on my dev server as well as a few different webhosts using php 7.1... but I'm trying to use x10hosting's free lamp hosting and the data being passed from $_GET is coming through as 403...

I've proved that it works on other servers as well as my own dev server with this

echo '<pre>', $route->path, $_GET['url'], '</pre>'; 

when going to the url http://app/admin... this line in my loop gives me what should be expected...

/admin
adminadmin

but on x10's server i get this

/403.shtml
admin403.shtml

I have tried encoding to base64 with urlencode($_GET) as well as disabling mod_sec in the .htaccess with

<IfModule mod_security.c>
  SecFilterEngine Off
  SecFilterScanPOST Off
</IfModule>

neither solution worked... I'm almost certain it's a server config issue but access is pretty much limited to .htaccess and php.ini .... I haven't touched php or apache in a while and am a little lost... any help would be greatly appreciated

  • 写回答

1条回答 默认 最新

  • duanjia9577 2018-11-08 19:41
    关注

    This does sound like a mod_security type issue. And, as you have found, you are unable to disable mod_security on the free hosting platform.

    I have encountered mod_sec rules on a number of shared hosts that simply block the request based on certain parameter names (supposedly blocking common XSS attempts). url is a common one. site is another. Simply changing the parameter name might be all that's required.

    "Free" hosting accounts are always going to have some restrictions. If this is the only thing that holds you back then you are lucky.

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

报告相同问题?

悬赏问题

  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程