Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/273.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用gif url中的参数重写url_Php_.htaccess_Mod Rewrite_Url Rewriting - Fatal编程技术网

Php .htaccess用gif url中的参数重写url

Php .htaccess用gif url中的参数重写url,php,.htaccess,mod-rewrite,url-rewriting,Php,.htaccess,Mod Rewrite,Url Rewriting,经过一些研究,我仍然无法找到一个适合我的解决方案 现在我有了这样一个url: --> 我想重写此url并使其在浏览器中显示,以便获得上面的时间参数: --> 实际上,我的最后一次尝试是这样的: ---.htaccess--- 我还不习惯用这种方式重写url,但仍然在查看文档和主题 谢谢您的考虑。这应该可以: RewriteEngine On RewriteRule ^([^/]*)/timer\.gif$ /images/values-lock/countdown-timer.php?time

经过一些研究,我仍然无法找到一个适合我的解决方案

现在我有了这样一个url:

-->

我想重写此url并使其在浏览器中显示,以便获得上面的时间参数:

-->

实际上,我的最后一次尝试是这样的:

---.htaccess---


我还不习惯用这种方式重写url,但仍然在查看文档和主题

谢谢您的考虑。

这应该可以:

RewriteEngine On
RewriteRule ^([^/]*)/timer\.gif$ /images/values-lock/countdown-timer.php?time=$1 [L]
你可以试试这个

 RewriteEngine On
 RewriteBase /images/values-lock/
 RewriteRule ^([0-9]+)/timer\.gif/?$ /images/values-lock/countdown-timer.php?time=$1 [QSA,L]

您可以在
文档\u ROOT/.htaccess
文件中使用此代码:

RewriteEngine On
RewriteBase /

RewriteCond %{THE_REQUEST} /images/values-lock/countdown-timer\.php\?time=([^\s&]+) [NC]
RewriteRule ^ %1/timer.gif? [R=302,L,NE]

RewriteRule ^([^/]+)/timer\.gif$ images/values-lock/countdown-timer.php?time=$1 [L,QSA,NC]

谢谢大家对我的帮助,我解决了我的问题:)
RewriteEngine On
RewriteBase /

RewriteCond %{THE_REQUEST} /images/values-lock/countdown-timer\.php\?time=([^\s&]+) [NC]
RewriteRule ^ %1/timer.gif? [R=302,L,NE]

RewriteRule ^([^/]+)/timer\.gif$ images/values-lock/countdown-timer.php?time=$1 [L,QSA,NC]