rewrite.html 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. {template 'common/header'}
  2. <div class="rewrite">
  3. <h3 class="rewrite-head">
  4. 伪静态需要管理员手动设置,设置教程如下:
  5. </h3>
  6. <div class="rewrite-box">
  7. <div class="rewrite-box-head">
  8. 设置访问模块
  9. </div>
  10. <div class="rewrite-box-body">
  11. <p>
  12. 配置伪静态前,请务必设置默认访问模块,若未设置 <a href="{php echo url('webapp/bind-domain')}" class="color-default">去设置 ></a>
  13. </p>
  14. <p>
  15. 配置好伪静态后,访问地址为:{if $url}{$url}{else}未配置,<a href="{php echo url('webapp/bind-domain')}" class="color-default">去设置 ></a>{/if}
  16. </p>
  17. </div>
  18. </div>
  19. <div class="rewrite-box">
  20. <div class="rewrite-box-head">
  21. 配置服务器
  22. </div>
  23. <div class="rewrite-box-body rewrite-rule">
  24. <p>如果您的服务器支持.htaccess,请将下面的规则复制,然后粘贴到.htaccess文件中。</p>
  25. <span>规则如下</span>
  26. <div class="alert alert-info">
  27. <code>
  28. RewriteEngine On&#10; <br>
  29. RewriteBase / &#10; <br>
  30. RewriteRule ^([0-9]+)-([0-9]+).html$ /app/index.php?i=$1&a=webapp&c=entry&eid=$2 &#10; <br>
  31. </code>
  32. <a href="javascript:;" id="copy-0" class="btn btn-primary" clipboard-rewrite supported="supported" text="1231" on-copied="success('1')">复制代码</a>
  33. </div>
  34. <h4>Apache服务器</h4>
  35. <p>Apache 1.x 的用户请检查 conf/httpd.conf 中是否存在如下两段代码:</p>
  36. <pre>
  37. LoadModule rewrite_module libexec/mod_rewrite.so
  38. AddModule mod_rewrite.c</pre>
  39. <p>Apache 2.x 的用户请检查 conf/httpd.conf 中是否存在如下一段代码: </p>
  40. <pre>
  41. LoadModule rewrite_module modules/mod_rewrite.so</pre>
  42. <p>如果存在,且以#开头,请删除#。</p>
  43. <p>后在配置文件 <b>(通常就是 conf/httpd.conf或者conf/extra/httpd-vhosts.conf)</b>中加入如下代码。此时请务必注意,如果网站使用通过虚拟主机来定义,请务必加到虚拟主机配置中去,如果加在虚拟主机配置外部将可能无法使用。改好后然后将 Apache 重启。</p>
  44. <span>规则如下</span>
  45. <div class="alert alert-info">
  46. <code>
  47. RewriteEngine On <br />
  48. RewriteBase / <br />
  49. RewriteRule ^([0-9]+)-([0-9]+).html$ /app/index.php?i=$1&a=webapp&c=entry&eid=$2 <br />
  50. </code>
  51. <a href="javascript:;" clipboard-rewrite class="btn btn-primary">复制代码</a>
  52. </div>
  53. <h4>Nginx服务器</h4>
  54. <span>规则如下</span>
  55. <div class="alert alert-info">
  56. <code>
  57. rewrite ^/([0-9]+)-([0-9]+).html$ /app/index.php?i=$1&a=webapp&c=entry&eid=$2;<br>
  58. </code>
  59. <a href="javascript:;" clipboard-rewrite class="btn btn-primary">复制代码</a>
  60. </div>
  61. <h4>IIS7服务器</h4>
  62. <p>配置请参考<a href="https://jingyan.baidu.com/article/63f23628556b2f0209ab3d6b.html" target="_blank" class="color-default"> 这里</a></p>
  63. <span>规则如下</span>
  64. <div class="alert alert-info">
  65. <code>
  66. RewriteEngine On <br />
  67. RewriteBase / <br />
  68. RewriteRule ^([0-9]+)-([0-9]+).html$ /app/index.php?i=$1&a=webapp&c=entry&eid=$2 <br />
  69. </code>
  70. <a href="javascript:;" clipboard-rewrite class="btn btn-primary">复制代码</a>
  71. </div>
  72. </div>
  73. </div>
  74. </div>
  75. <script>
  76. require(['clipboard'], function(Clipboard){
  77. var clipboardRewrite = new Clipboard("[clipboard-rewrite]", {
  78. text: function(v) {
  79. return $(v).prev('code').text();
  80. }
  81. });
  82. clipboardRewrite.on('success', function(e) {
  83. if (!$(e.trigger).next('.cope-info').length) {
  84. $(e.trigger).after('<a class="cope-info" style=" margin-left: 5px; vertical-align: middle;">复制成功, 粘贴到配置文件并重启网站服务器</a>')
  85. }
  86. setTimeout(function() {
  87. $(e.trigger).next('.cope-info').remove()
  88. }, 100110)
  89. e.clearSelection()
  90. })
  91. })
  92. </script>
  93. {template 'common/footer'}