相关疑难解决方法(0)

在URL中传递base64编码的字符串

通过GET参数传递原始base64编码字符串是否安全?

php string url base64 get

227
推荐指数
7
解决办法
27万
查看次数

urlencoded正斜杠正在破坏URL

关于系统

我的项目中有这种格式的URL: -

http://project_name/browse_by_exam/type/tutor_search/keyword/class/new_search/1/search_exam/0/search_subject/0
Run Code Online (Sandbox Code Playgroud)

其中关键字/类对意味着使用"class"关键字进行搜索.

我有一个常见的index.php文件,它为项目中的每个模块执行.只有一个重写规则可以从URL中删除index.php: -

RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [L,QSA]
Run Code Online (Sandbox Code Playgroud)

我在阅读搜索URL时准备搜索URL和urldecode()时使用urlencode().

问题

只有正斜杠字符会破坏导致404页面未找到错误的URL.例如,如果我搜索one/twoURL是

http://project_name/browse_by_exam/type/tutor_search/keyword/one%2Ftwo/new_search/1/search_exam/0/search_subject/0/page_sort/
Run Code Online (Sandbox Code Playgroud)

我该如何解决?我需要将index.php隐藏在URL中.否则,如果不需要,那么正斜杠就没有问题了,我可以使用这个URL: -

http://project_name/index.php?browse_by_exam/type/tutor_search/keyword/one
%2Ftwo/new_search/1/search_exam/0/search_subject/0
Run Code Online (Sandbox Code Playgroud)

.htaccess url-rewriting url-encoding http-status-code-404

70
推荐指数
3
解决办法
11万
查看次数