htaccess 捕获所有图像请求并重定向到正确的文件夹
我如何将所有图像请求重定向到特定文件夹,因为我的网站有一些 mod 重写以获得更好的 url,有时当找不到图像时,它由主访问路由处理,这是错误的,因为 htaccess 应该正确重定向。
我已经得到:
Options +FollowSymlinks
RewriteEngine on
RewriteBase /
RewriteRule ^$ index.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/?([^/]*)/?/?([^/]*)/?([^/]*)$ index.php?account=$1&task=$2&object_id=$3&app_type=$4
所有图像请求都应路由到 /public/images/
提前致谢。
how do i redirect all image requests to a specific folder, since my site has some mod rewriting for nicer urls, sometimes when an image is not found it is handled by the main access route, which is wrong, since htaccess should redirect properly.
i already got:
Options +FollowSymlinks
RewriteEngine on
RewriteBase /
RewriteRule ^$ index.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/?([^/]*)/?/?([^/]*)/?([^/]*)$ index.php?account=$1&task=$2&object_id=$3&app_type=$4
all image requests should be routed to /public/images/
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)