Php 使用htaccess重写映像目录
这是旧地址Php 使用htaccess重写映像目录,php,.htaccess,mod-rewrite,Php,.htaccess,Mod Rewrite,这是旧地址 http://sie.com/files/images/2013/12/600x415_img.jpg 请注意,所有图像名称都以600x 也 image2013/12/之前的2个目录是动态创建的,根据月份/年份的不同,其他图像的目录可能会有所不同 我想将所有这些链接重定向到(所有600x图像都已移动到新目录) 基本上将文件替换为拇指 这是我有的,但不起作用 RewriteRule ^files/images/([0-9]*)/([0-9]*)/600x(.*)$ thumbs/im
http://sie.com/files/images/2013/12/600x415_img.jpg
请注意,所有图像名称都以600x
也
image2013/12/
之前的2个目录是动态创建的,根据月份/年份的不同,其他图像的目录可能会有所不同
我想将所有这些链接重定向到(所有600x图像都已移动到新目录)
基本上将文件
替换为拇指
这是我有的,但不起作用
RewriteRule ^files/images/([0-9]*)/([0-9]*)/600x(.*)$ thumbs/images/$1/$2/600x$3[L]
这是我目前的访问权限
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^img\.site\.com$ [NC]
RewriteRule ^(images/.+)$ site.com/files/$1 [R=301,NC,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
</IfModule>
重新启动发动机
重写基/
RewriteCond%{HTTP_HOST}^img\.site\.com$[NC]
重写规则^(images/+)$site.com/files/$1[R=301,NC,L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
RewriteCond%{ENV:REDIRECT_STATUS}^$
重写规则^(.*)$index.php/$1[L,QSA]
你能试试这个吗
RewriteRule ^files/images/(\d+)/(\d+)/600x(.*)$ /thumbs/images/$1/$2/600x$3 [L]
RewriteRule ^files/images/(\d+)/(\d+)/600x(.*)$ /thumbs/images/$1/$2/600x$3 [L]