- XF兼容
- 2.1.x
- 2.2.x
- 2.3.x
根据配置,此附加组件需要网络服务器 URL 重写支持!允许将 SVG(可扩展矢量图形)图像存储为模板。这将在 XF 根目录中创建一个新的 svg .php 文件。生成指向 SVG 模板的链接;
To generate a link to an SVG template;
Under Board information, if "Use Full Friendly URLs" (useFriendlyUrls) is set the URL generated is:
Otherwise
Nginx URL rewrite config
Apache URL rewrite config
Add the rule before the final reference;
ie, should look similar to;
To generate a link to an SVG template;
XML:
{{ getSvgUrl('tempate.svg') }}
XML:
{{ getSvgUrl('tempate.svg') }}
XML:
svg.php?svg=<templateName>&s=<style_id>&l=<langauge_id>&d=<style_last_modified>
HTML:
location ^~ /data/svg/ {
access_log off;
rewrite ^/data/svg/([^/]+)/([^/]+)/([^/]+)/([^\.]+).svg$ /svg.php?svg=$4&s=$1&l=$2&d=$3$args last;
return 403;
}
Add the rule before the final reference;
data/
HTML:
RewriteRule ^data/svg/([^/]+)/([^/]+)/([^/]+)/([^\.]+).svg$ svg.php?svg=$4&s=$1&l=$2&d=$3 [B,NC,L,QSA]
HTML:
# If you are having problems with the rewrite rules, remove the "#" from the
# line that begins "RewriteBase" below. You will also have to change the path
# of the rewrite to reflect the path to your XenForo installation.
#RewriteBase /xenforo
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^data/svg/([^/]+)/([^/]+)/([^/]+)/([^\.]+).svg$ svg.php?svg=$4&s=$1&l=$2&d=$3 [B,NC,L,QSA]
RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]
RewriteRule ^.*$ index.php [NC,L]