问题原文
原帖链接 · joloshop · CC BY-SA 4.0
I had to move my image folder.
Before it was example.com/shoplogo/(name*).png now its example.com/shop-logo/(name*).png just stuck with the rewrite rule :-(.
已采纳解答
原帖链接 · MrWhite · CC BY-SA 4.0
Presumably the visible links to your images remain the same and point to the old location: shoplogo and you need to internally rewrite the request to the correct location (ie. shop-logo) so that they still work.
Then you can do something like the following using mod_rewrite at the top of your .htaccess file in the root of your site:
RewriteEngine On
RewriteRule ^shoplogo/([^/]+\.png)$ /shop-logo/$1 [L]
$1 is a backreference to the captured filename.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
