无意中我的 htaccess 脚本正在更改图像 URL,因此其 URL 路径中带有“portfolio/”的任何图像都会受到不利影响。
有没有办法从该特定规则中排除图像?
redirect 301 "/sitemap.xml" http://www.example.com/sitemap.php
RewriteEngine On
RewriteCond %{REQUEST_URI} !portfolio/project
RewriteCond %{REQUEST_URI} /.*portfolio/.*$ [NC]
RewriteRule ^(.*)portfolio(.*)$ /$1portfolio/project$2 [R=301,L]
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/sitemap.php
RewriteRule ^(.*)$ /index.php/$1 [L]