241 lines
15 KiB
HTML
241 lines
15 KiB
HTML
{template "header.html"}
|
||
|
||
<style>
|
||
.help-wrap { margin: 0 auto; padding: 10px 0 30px; color: #334155; line-height: 1.75; }
|
||
.help-note { margin: 0 0 16px; padding: 12px 16px; background: #f8fafc; border-left: 4px solid #2563eb; color: #475569; }
|
||
.help-feature { margin-bottom: 20px; padding: 16px 18px; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; }
|
||
.help-feature-title { margin: 0 0 10px; font-size: 16px; font-weight: 600; color: #1e293b; }
|
||
.help-feature-desc p { margin: 0 0 8px; }
|
||
.help-feature-desc ul { margin: 8px 0 0; padding-left: 20px; }
|
||
.help-feature-desc li { margin-bottom: 6px; }
|
||
.help-steps { margin: 0; padding-left: 22px; }
|
||
.help-step { margin-bottom: 18px; }
|
||
.help-step-title { display: block; margin-bottom: 6px; font-size: 15px; font-weight: 600; color: #1e293b; }
|
||
.help-step-desc { margin: 0; color: #475569; }
|
||
.help-summary { margin-top: 18px; padding: 14px 16px; background: #eff6ff; border-radius: 8px; color: #1e40af; }
|
||
.help-code { display: inline-block; margin: 2px 0; padding: 2px 8px; font-family: Consolas, monospace; font-size: 13px; background: #f1f5f9; border-radius: 4px; color: #0f172a; word-break: break-all; }
|
||
.help-pre { margin: 8px 0; padding: 12px 14px; font-family: Consolas, monospace; font-size: 13px; background: #0f172a; color: #e2e8f0; border-radius: 8px; overflow-x: auto; white-space: pre-wrap; }
|
||
.help-table { width: 100%; margin: 8px 0; border-collapse: collapse; font-size: 13px; }
|
||
.help-table th, .help-table td { padding: 8px 10px; border: 1px solid #e2e8f0; text-align: left; vertical-align: top; }
|
||
.help-table th { background: #f8fafc; font-weight: 600; }
|
||
.help-link { color: #2563eb; text-decoration: none; }
|
||
.help-link:hover { text-decoration: underline; }
|
||
</style>
|
||
|
||
<div class="portlet light bordered">
|
||
<div class="portlet-title tabbable-line">
|
||
<ul class="nav nav-tabs" style="float:left;">
|
||
<li class="{if $page==0}active{/if}">
|
||
<a href="{dr_url('module/help/url', ['page' => 0])}"><i class="fa fa-info-circle"></i> {dr_lang('概述')}</a>
|
||
</li>
|
||
<li class="{if $page==1}active{/if}">
|
||
<a href="{dr_url('module/help/url', ['page' => 1])}"><i class="fa fa-tags"></i> {dr_lang('规则与通配符')}</a>
|
||
</li>
|
||
<li class="{if $page==2}active{/if}">
|
||
<a href="{dr_url('module/help/url', ['page' => 2])}"><i class="fa fa-list-ol"></i> {dr_lang('配置流程')}</a>
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
<div class="portlet-body">
|
||
<div class="help-wrap">
|
||
|
||
{if $page==0}
|
||
<div class="help-section-body">
|
||
<p class="help-note">{dr_lang('自定义 URL 可将动态地址(如 index.php?s=news&c=show&id=1)转换为伪静态友好链接(如 news/show-1.html)。需同时配置「URL 规则」与服务器「伪静态解析」。')}</p>
|
||
|
||
<div class="help-feature">
|
||
<h3 class="help-feature-title">{dr_lang('动态地址 vs 自定义 URL')}</h3>
|
||
<div class="help-feature-desc">
|
||
<table class="help-table">
|
||
<thead>
|
||
<tr><th>{dr_lang('类型')}</th><th>{dr_lang('示例')}</th><th>{dr_lang('说明')}</th></tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>{dr_lang('动态地址')}</td>
|
||
<td><span class="help-code">index.php?s=news&c=show&id=1</span></td>
|
||
<td>{dr_lang('无需服务器 rewrite,开箱可用')}</td>
|
||
</tr>
|
||
<tr>
|
||
<td>{dr_lang('自定义 URL')}</td>
|
||
<td><span class="help-code">news/show-1.html</span></td>
|
||
<td>{dr_lang('需 URL 规则 + 伪静态解析 + 服务器配置')}</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="help-feature">
|
||
<h3 class="help-feature-title">{dr_lang('规则绑定位置')}</h3>
|
||
<div class="help-feature-desc">
|
||
<table class="help-table">
|
||
<thead>
|
||
<tr><th>{dr_lang('绑定位置')}</th><th>{dr_lang('适用')}</th><th>{dr_lang('入口')}</th></tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>{dr_lang('全站 URL 规则')}</td>
|
||
<td>{dr_lang('共享模块栏目页、内容页(type=3)')}</td>
|
||
<td><a class="help-link" href="{dr_url('module/seo_site/index')}">{dr_lang('站点SEO')}</a></td>
|
||
</tr>
|
||
<tr>
|
||
<td>{dr_lang('模块 URL 规则')}</td>
|
||
<td>{dr_lang('独立模块首页、栏目、内容、搜索(type=1)')}</td>
|
||
<td><a class="help-link" href="{dr_url('module/seo_module/index')}">{dr_lang('模块SEO')}</a></td>
|
||
</tr>
|
||
<tr>
|
||
<td>{dr_lang('搜索 URL 规则')}</td>
|
||
<td>{dr_lang('共享模块搜索页(type=2)')}</td>
|
||
<td><a class="help-link" href="{dr_url('module/seo_module/index')}">{dr_lang('模块SEO')}</a>({dr_lang('共享模块')})</td>
|
||
</tr>
|
||
<tr>
|
||
<td>{dr_lang('URL 规则管理')}</td>
|
||
<td>{dr_lang('创建、编辑、导入导出规则')}</td>
|
||
<td><a class="help-link" href="{dr_url('module/urlrule/index')}">{dr_lang('URL规则')}</a></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="help-summary">
|
||
<strong>{dr_lang('注意')}:</strong>
|
||
{dr_lang('使用自定义 URL 后必须配置伪静态解析,否则页面无法正常打开。配置文件:')} <span class="help-code">/config/rewrite.php</span>
|
||
</div>
|
||
</div>
|
||
{/if}
|
||
|
||
{if $page==1}
|
||
<div class="help-section-body">
|
||
<p class="help-note">{dr_lang('在')} <a class="help-link" href="{dr_url('module/urlrule/index')}">{dr_lang('URL规则')}</a> {dr_lang('中添加规则时,按类别填写各页面 URL 格式;输入框旁的「提示」按钮可查看通配符说明。')}</p>
|
||
|
||
<div class="help-feature">
|
||
<h3 class="help-feature-title">{dr_lang('URL 规则类别')}</h3>
|
||
<div class="help-feature-desc">
|
||
<table class="help-table">
|
||
<thead>
|
||
<tr><th>{dr_lang('类别')}</th><th>{dr_lang('包含页面')}</th></tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr><td>{dr_lang('独立模块')}(type=1)</td><td>{dr_lang('模块首页、栏目页、栏目分页、内容页、内容分页、搜索页、搜索分页')}</td></tr>
|
||
<tr><td>{dr_lang('共享模块搜索')}(type=2)</td><td>{dr_lang('搜索页、搜索分页')}</td></tr>
|
||
<tr><td>{dr_lang('共享栏目和内容页')}(type=3)</td><td>{dr_lang('栏目页、栏目分页、内容页、内容分页')}</td></tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="help-feature">
|
||
<h3 class="help-feature-title">{dr_lang('常用通配符')}</h3>
|
||
<div class="help-feature-desc">
|
||
<table class="help-table">
|
||
<thead>
|
||
<tr><th>{dr_lang('通配符')}</th><th>{dr_lang('说明')}</th></tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr><td>{code}{modname}{/code}</td><td>{dr_lang('模块目录名')}</td></tr>
|
||
<tr><td>{code}{id}{/code}</td><td>{dr_lang('栏目 ID 或内容 ID')}</td></tr>
|
||
<tr><td>{code}{dirname}{/code}</td><td>{dr_lang('栏目目录名称')}</td></tr>
|
||
<tr><td>{code}{pdirname}{/code}</td><td>{dr_lang('含上级的栏目目录路径')}</td></tr>
|
||
<tr><td>{code}{opdirname}{/code}</td><td>{dr_lang('父级栏目目录名')}</td></tr>
|
||
<tr><td>{code}{otdirname}{/code}</td><td>{dr_lang('顶级栏目目录名')}</td></tr>
|
||
<tr><td>{code}{page}{/code}</td><td>{dr_lang('分页页码')}</td></tr>
|
||
<tr><td>{code}{y}{/code} / {code}{m}{/code} / {code}{d}{/code}</td><td>{dr_lang('内容发布年/月/日')}</td></tr>
|
||
</tbody>
|
||
</table>
|
||
<p style="margin-top:10px;">{dr_lang('连接符号')} <span class="help-code">catjoin</span> {dr_lang('用于')} {code}{pdirname}{/code} {dr_lang('多级目录连接,默认为')} <span class="help-code">/</span>({dr_lang('如')} china/beijing)。</p>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="help-feature">
|
||
<h3 class="help-feature-title">{dr_lang('规则示例')}</h3>
|
||
<div class="help-feature-desc">
|
||
<p><strong>{dr_lang('内容页')}</strong> — {dr_lang('默认')} <span class="help-code">index.php?s=news&c=show&id=1</span></p>
|
||
<pre class="help-pre">{code}show/{id}.html
|
||
{modname}/{y}/{m}{id}.html
|
||
{pdirname}/{id}.html{/code}</pre>
|
||
<p><strong>{dr_lang('栏目页')}</strong> — {dr_lang('默认')} <span class="help-code">index.php?s=news&c=category&id=1</span></p>
|
||
<pre class="help-pre">{code}{dirname}/{id}.html
|
||
{pdirname}/index.html
|
||
{modname}/list-{page}.html{/code}</pre>
|
||
<p><strong>{dr_lang('搜索页')}</strong></p>
|
||
<pre class="help-pre">{code}{modname}/search.html
|
||
{modname}/search-{page}.html{/code}</pre>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
{/if}
|
||
|
||
{if $page==2}
|
||
<div class="help-section-body">
|
||
<p class="help-note">{dr_lang('完整启用自定义 URL 需四步:创建规则 → 绑定到站点/模块 → 生成伪静态解析 → 部署到 Web 服务器。')}</p>
|
||
|
||
<ol class="help-steps">
|
||
<li class="help-step">
|
||
<span class="help-step-title">{dr_lang('第一步:创建 URL 规则')}</span>
|
||
<p class="help-step-desc">
|
||
进入 <a class="help-link" href="{dr_url('module/urlrule/index')}">{dr_lang('URL规则')}</a> → {dr_lang('添加')},
|
||
选择类别(独立模块 / 共享搜索 / 共享栏目内容),
|
||
按页面类型填写 URL 格式,保存规则。
|
||
</p>
|
||
</li>
|
||
<li class="help-step">
|
||
<span class="help-step-title">{dr_lang('第二步:绑定规则')}</span>
|
||
<p class="help-step-desc">
|
||
共享模块:在 <a class="help-link" href="{dr_url('module/seo_site/index')}">{dr_lang('站点SEO')}</a> 的「全局设置URL规则」中选择 type=3 规则;
|
||
独立模块:在 <a class="help-link" href="{dr_url('module/seo_module/index')}">{dr_lang('模块SEO')}</a> 各模块 Tab 的「模块URL规则」中选择 type=1 规则;
|
||
共享搜索:在模块 SEO(共享模块)的「搜索URL规则」中选择 type=2 规则。
|
||
</p>
|
||
</li>
|
||
<li class="help-step">
|
||
<span class="help-step-title">{dr_lang('第三步:更新缓存')}</span>
|
||
<p class="help-step-desc">
|
||
绑定规则后执行系统缓存更新;
|
||
可在站点 SEO 页使用「批量更新内容URL」按模块刷新已有内容的链接地址。
|
||
</p>
|
||
</li>
|
||
<li class="help-step">
|
||
<span class="help-step-title">{dr_lang('第四步:伪静态解析')}</span>
|
||
<p class="help-step-desc">
|
||
进入 <a class="help-link" href="{dr_url('module/urlrule/rewrite_index')}">{dr_lang('伪静态解析')}</a>,
|
||
点击「生成解析规则」,将代码写入 <span class="help-code">/config/rewrite.php</span>;
|
||
再按页面提示在 Nginx / Apache / IIS 中配置 rewrite 规则;
|
||
使用「环境检测」验证各域名是否支持伪静态。
|
||
</p>
|
||
</li>
|
||
<li class="help-step">
|
||
<span class="help-step-title">{dr_lang('第五步:验证')}</span>
|
||
<p class="help-step-desc">
|
||
访问前台栏目列表、内容详情、搜索页,确认链接已为自定义格式且页面正常打开;
|
||
若 404,检查 rewrite 配置与 <span class="help-code">rewrite.php</span> 是否匹配当前 URL 规则。
|
||
</p>
|
||
</li>
|
||
</ol>
|
||
|
||
<div class="help-feature" style="margin-top:20px;">
|
||
<h3 class="help-feature-title">{dr_lang('常见问题')}</h3>
|
||
<div class="help-feature-desc">
|
||
<ul>
|
||
<li><strong>{dr_lang('自定义 URL 后 404')}</strong>:{dr_lang('检查伪静态解析是否生成并部署;Nginx 需 reload;Apache 需开启 mod_rewrite')}</li>
|
||
<li><strong>{dr_lang('链接仍是动态地址')}</strong>:{dr_lang('确认规则已绑定;更新缓存;批量更新内容 URL')}</li>
|
||
<li><strong>{dr_lang('部分页面正常部分 404')}</strong>:{dr_lang('检查规则类别是否选对(独立模块用 type=1,共享内容用 type=3)')}</li>
|
||
<li><strong>{dr_lang('多站点/多域名')}</strong>:{dr_lang('伪静态解析页按域名分别检测;各域名 rewrite 配置需一致')}</li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="help-summary">
|
||
<strong>{dr_lang('相关')}:</strong>
|
||
{dr_lang('页面 title/meta 配置见')}
|
||
<a class="help-link" href="{dr_url('module/help/seo')}">{dr_lang('SEO用法')}</a>
|
||
</div>
|
||
</div>
|
||
{/if}
|
||
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
{template "footer.html"}
|