Blogger Information
Blog 93
fans 0
comment 0
visits 123402
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
用小鸟云服务器搭建网站常用的伪静态设置规则
想无
Original
649 people have browsed it

用云服务器搭建网站后,网站本身是动态的网页,就比如.php、.asp、.aspx等格式,这类网页还带“?”加参数来读取数据库。在设置伪静态后,动态的网页可以被转换写成静态网页类型的页面。

今天设置伪静态的时候碰到问题,琢磨半天不得其解,最后是参考了小鸟云的文章才把伪静态设置好的。

参考如下:

Discuz X3.2

  1. 1.RewriteEngine On
  2. 2.RewriteBase /
  3. 3.RewriteCond %{QUERY_STRING} ^(.*)$
  4. 4.RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%1
  5. 5.RewriteCond %{QUERY_STRING} ^(.*)$
  6. 6.RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1
  7. 7.RewriteCond %{QUERY_STRING} ^(.*)$
  8. 8.RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1
  9. 9.RewriteCond %{QUERY_STRING} ^(.*)$
  10. 10.RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1
  11. 11.RewriteCond %{QUERY_STRING} ^(.*)$
  12. 12.RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1
  13. 13.RewriteCond %{QUERY_STRING} ^(.*)$
  14. 14.RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1
  15. 15.RewriteCond %{QUERY_STRING} ^(.*)$
  16. 16.RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1
  17. 17.RewriteCond %{QUERY_STRING} ^(.*)$
  18. 18.RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1
  19. 19.RewriteCond %{QUERY_STRING} ^(.*)$
  20. 20.RewriteRule ^([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html$ plugin.php?id=$1:$2&%1

Wordpress

  1. 1.RewriteEngine On
  2. 2.RewriteBase /
  3. 3.RewriteRule ^index\.php$ - [L]
  4. 4.RewriteCond %{REQUEST_FILENAME} !-f
  5. 5.RewriteCond %{REQUEST_FILENAME} !-d
  6. 6.RewriteRule . /index.php [L]

Typecho

  1. 1.RewriteEngine On
  2. 2.RewriteBase /
  3. 3.RewriteCond %{REQUEST_FILENAME} !-f
  4. 4.RewriteCond %{REQUEST_FILENAME} !-d
  5. 5.RewriteRule ^(.*)$ /index.php/$1 [L]
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!