Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/256.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_Regex_.htaccess_Url - Fatal编程技术网

Php 在文件夹中隐藏具有.htaccess的查询字符串

Php 在文件夹中隐藏具有.htaccess的查询字符串,php,regex,.htaccess,url,Php,Regex,.htaccess,Url,我想打开此url: http://mysite.com/images/?url=20121206/test.jpg&zoom=120&f=g 为此: http://mysite.com/images/20121206/test.jpg?zoom=120&f=g /images/文件夹中的.htaccess文件 我在谷歌上搜索了很多正则表达式,但都没用。请帮忙 或者可以在“图像”文件夹外执行此操作?是否可以 RewriteCond %{REQUEST_FILENAME}

我想打开此url:

http://mysite.com/images/?url=20121206/test.jpg&zoom=120&f=g
为此:

http://mysite.com/images/20121206/test.jpg?zoom=120&f=g
/images/文件夹中的.htaccess文件

我在谷歌上搜索了很多正则表达式,但都没用。请帮忙

或者可以在“图像”文件夹外执行此操作?

是否可以

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule images/(.*) images/index.php?url=$1 [QSA,L]

我相信这应该能完成任务

Options +FollowSymlinks
RewriteEngine On
RewriteCond %{QUERY_STRING} url=(.*)
RewriteRule /images/ /images/%1 [QSA, R]

图像仍然没有改变,编辑了它。刚意识到您没有在URL中指定index.php文件。请在浏览器中尝试新版本,并让我知道它将URL重写为什么。