bo-blog在dreamhost空间的”高级URL Rewrite“问题及解决办法

林继 VPS 知识 6,189 共写了251个字 (2007-12-20 22:38:37) 没有评论 打印 扫描二维码 百度未收录

来源:Bo-Blog交流论坛

我使用的是dreamhost的空间,典型的LAMP配置(Linux+Apache+Mysql+PHP),bo-blog v2.01以及v2.10的”基于PHP自身的URL优化 “能够顺利启用,但是,每当我启用”高级URL Rewrite“后,就会得到”500 Internal Server Error“(当然,测试页也是无法通过的)。

修改后的.htaccess,也就是能够在dreamhost上使用的.htaccess的内容:

  1. RewriteEngine on
  2. RewriteBase /
  3. #上面这句是blog所在的文件夹,我是放在根目录
  4. RewriteCond %{REQUEST_FILENAME} -f [OR]
  5. RewriteCond %{REQUEST_FILENAME} -d
  6. RewriteRule ^.*$ - [L]
  7.  
  8. RewriteRule ^post/([0-9]+)/?([0-9]+)?/?([0-9]+)?/?$ read.php?entryid=$1&page=$2&part=$3 [QSA,L]
  9. RewriteRule ^page/([0-9]+)/([0-9]+)/?$ index.php?mode=$1&page=$2 [QSA,L]
  10. RewriteRule ^starred/([0-9]+)/?([0-9]+)?/?$ star.php?mode=$1&page=$2 [QSA,L]
  11. RewriteRule ^category/([0-9]+)/?([0-9]+)?/?([0-9]+)?/?$ index.php?go=category_$1&mode=$2&page=$3 [QSA,L]
  12. RewriteRule ^archiver/([0-9]+)/([0-9]+)/?([0-9]+)?/?([0-9]+)?/?$ index.php?go=archive&cm=$1&cy=$2&mode=$3&page=$4 [QSA,L]
  13. RewriteRule ^date/([0-9]+)/([0-9]+)/([0-9]+)/?([0-9]+)?/?([0-9]+)?/?$ index.php?go=showday_$1-$2-$3&mode=$4&page=$5 [QSA,L]
  14. RewriteRule ^user/([0-9]+)/?$ view.php?go=user_$1 [L]
  15. RewriteRule ^tags/([^/]+)/?([0-9]+)?/?([0-9]+)?/?$ tag.php?tag=$1&mode=$2&page=$3 [QSA,L]
  16.  
  17.  
  18. #Force redirection for old rules
  19. RewriteRule ^post/([0-9]+)\.htm$ post/$1/ [R=301,L]
  20. RewriteRule ^post/([0-9]+)\_([0-9]+)\.htm$ post/$1/$2/ [R=301,L]
  21. RewriteRule ^post/([0-9]+)\_([0-9]+)\_([0-9]+)\.htm$ post/$1/$2/$3/ [R=301,L]
  22. RewriteRule ^index\_([0-9]+)\_([0-9]+)\.htm$ page/$1/$2/ [R=301,L]
  23. RewriteRule ^star\_([0-9]+)\_([0-9]+)\.htm$ starred/$1/$2/ [R=301,L]
  24. RewriteRule ^category\_([0-9]+)\.htm$ category/$1/ [R=301,L]
  25. RewriteRule ^category\_([0-9]+)\_([0-9]+)\_([0-9]+)\.htm$ category/$1/$2/$3/ [R=301,L]
  26. RewriteRule ^archive\_([0-9]+)\_([0-9]+)\.htm$ archiver/$1/$2/ [R=301,L]
  27. RewriteRule ^archive\_([0-9]+)\_([0-9]+)\_([0-9]+)\_([0-9]+)\.htm$ archiver/$1/$2/$3/$4/ [R=301,L]
  28. RewriteRule ^showday\_([0-9]+)\_([0-9]+)\_([0-9]+)\.htm$ date/$1/$2/$3/ [R=301,L]
  29. RewriteRule ^showday\_([0-9]+)\_([0-9]+)\_([0-9]+)\_([0-9]+)\_([0-9]+)\.htm$ date/$1/$2/$3/$4/$5/ [R=301,L]
  30.  
  31. #Customized URL
  32. RewriteRule ^([^\/]*)\.html$ $1/ [R=301,L]
  33. RewriteRule ^([^/|.]*)/?([0-9]+)?/?([0-9]+)?/?$ read.php?blogalias=$1&page=$2&part=$3 [QSA,L]

如果觉得我的文章对您有用,请随意赞赏。您的支持将鼓励我继续创作!

发表评论

电子邮件地址不会被公开。 必填项已用*标注

< >