我有直接的照片链接:http://upload.domain.com/image-upload/date/original-generated_name.jpg 它是上传照片信息的直接链接。 这个直接链接胸围重定向到:http://upload.domain.com/view/genarated_name.jpg到我现在的htacces(没有任何重定向选项)。
# BEGIN Scripteen FREE Image Hosting Script
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# general catch-all
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?page=$1&%{QUERY_STRING} [L]
</IfModule>
# END
您对如何做到这一点有什么建议吗?
答案 0 :(得分:0)
将此规则放在根.htaccess
文件中:
RewriteEngine On
RewriteRule ^image\.uploads/[^/]+/original-(.+)$ /view-image/$1 [NC,L,R=302]
# general catch-all
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?page=$1 [L,QSA]