doumo0206 2014-07-09 13:12
浏览 27

如何在共享主机上编码Laravel 4的URL?

My project works properly with WAMP on a local host.

On the other hand, on a shared production hosting, I have some troubles with one of my routes: Route::get('sth/{encodedURI}',array('uses'=>'MyController@sth'))->where('encodedURI','.*');

The URL looks like this: http://mywebsite.com/sth/http%3A%2F%2Fany-url.com

The route does not work, as I get a 404 error, as soon as there are some encoded characters in the url..

I guess the trick is not so complicated... but I'm stuck.

  • 写回答

1条回答 默认 最新

  • dorv56831 2014-07-09 16:00
    关注

    Well, I imagined a quite dirty workaround. But it's working.

    Before sending the URL, I replace the problematic % by @@@which is supposed to be quite rare.

    Then, on the targeted page, I retranslate the @@@into % before decoding properly the URI component.

    评论

报告相同问题?

悬赏问题

  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 unity第一人称射击小游戏,有demo,在原脚本的基础上进行修改以达到要求
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)