Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/238.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php htaccess重写不重定向_Php_Apache_.htaccess_Mod Rewrite - Fatal编程技术网

Php htaccess重写不重定向

Php htaccess重写不重定向,php,apache,.htaccess,mod-rewrite,Php,Apache,.htaccess,Mod Rewrite,非常感谢您在以下方面的帮助 我正在构建一个应用程序,希望避免IDOR(不安全的直接对象引用) https://example.com/folder1/index.php?folder2=Xyz&filename=Abc&variable=Pqr 在“folder1”中使用htaccess,我想将上述URL重写为一个以folder1名称结尾的干净URL 我尝试了以下方法,但无效 Options +FollowSymlinks RewriteEngine on RewriteCond %{REQUE

非常感谢您在以下方面的帮助

我正在构建一个应用程序,希望避免IDOR(不安全的直接对象引用)

https://example.com/folder1/index.php?folder2=Xyz&filename=Abc&variable=Pqr

在“folder1”中使用htaccess,我想将上述URL重写为一个以folder1名称结尾的干净URL

我尝试了以下方法,但无效

Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/index-([a-z]+)-([a-z]+)-([a-z]+) https://example.com/folder1/index.php?folder2=$1&filename=$2&variable=$3 [NC,L,QSA]

提前感谢您的帮助

这将是最好的,如果我能得到以下:谢谢你帮助阿努巴瓦,非常好奇得到解决方案,如果你能建议一个解决方案,谢谢!那没有多大意义。
https://example.com/folder1/
映射到
https://example.com/folder1/index.php?folder2=Xyz&filename=Abc&variable=Pqr
?嗯,我们可以得到以下格式的链接吗。我只是试图避免显示将被解析的id。请随时为
https://example.com/folder1/index.php?folder2=Xyz&filename=Abc&variable=Pqr
URL您可以使用:
https://example.com/folder1/Xyz/Abc/Pqr
如果我能得到以下信息,那将是最好的:感谢您帮助Anubhava,非常想得到解决方案,如果您能建议修复方案,我将不胜感激!那没有多大意义。
https://example.com/folder1/
映射到
https://example.com/folder1/index.php?folder2=Xyz&filename=Abc&variable=Pqr
?嗯,我们可以得到以下格式的链接吗。我只是试图避免显示将被解析的id。请随时为
https://example.com/folder1/index.php?folder2=Xyz&filename=Abc&variable=Pqr
URL您可以使用:
https://example.com/folder1/Xyz/Abc/Pqr