Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/32.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 重写codeigniter或htaccess中图像文件的url_Php_Apache_.htaccess_Codeigniter_Mod Rewrite - Fatal编程技术网

Php 重写codeigniter或htaccess中图像文件的url

Php 重写codeigniter或htaccess中图像文件的url,php,apache,.htaccess,codeigniter,mod-rewrite,Php,Apache,.htaccess,Codeigniter,Mod Rewrite,我需要一个在codeigniter或htaccess中重写图像文件路径的解决方案。下面我已经给出了重定向url应该是怎样的。我正在使用路由器文件重写其他URL。请帮我做这件事 原始路径 重写路径 在.htaccess文件中尝试以下操作: <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^static/images\/(.*\.(gif|jpg|png|jpeg))?$ assets/uplo

我需要一个在codeigniter或htaccess中重写图像文件路径的解决方案。下面我已经给出了重定向url应该是怎样的。我正在使用路由器文件重写其他URL。请帮我做这件事

原始路径

重写路径

在.htaccess文件中尝试以下操作:

    <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteRule ^static/images\/(.*\.(gif|jpg|png|jpeg))?$ assets/upload/subfolder/$1 [QSA,L]
    </IfModule>
它将包含“静态/图像”的URL替换为“资产/上载/子文件夹/”