美国vps的一些设置问题,乱码,伪静态,重启apache
作者:fengyn 日期:2009-12-30
设置vps
Linux VPS设置同时支持GBK(GB2312)和UTF-8编码
登陆SSH
到目录/etc/httpd/conf/,找到 httpd.conf
Apache中决定服务器编码的httpd.conf中AddDefaultCharset决定的,我设置为AddDefaultCharset utf-8,所以服务器默认是utf-8的;AddDefaultCharset utf-8上面有一段注释:
# Specify a default charset for all content served; this enables
# interpretation of all content as UTF-8 by default. To use the
# default browser choice (ISO-8859-1), or to allow the META tags
# in HTML content to override this choice, comment out this
# directive:
大概意思是:指定一个默认的字符集传送内容;这将所有内容默认以utf-8编码解析。如果要使用浏览器默认选择(ISO-8859-1),或允许使用HTML的META来自动选择浏览器编码,注释掉这行即可。
那就是改为#AddDefaultCharset utf-8,这样此行不再起作用,浏览器将根据网页的META来选择字符编码,apache就可以支持多字符编码了。
linux虚拟主机伪静态
apache
discuz论坛
新建一个文本文件: new.htaccess 输入以下文字:
<IfModule mod_rewrite.c>
# 将 RewriteEngine 模式打开
RewriteEngine On
# 修改以下语句中的 / 为你的论坛目录地址,如果程序放在bbs中,请将 / 修改为 /bbs
RewriteBase /
# Rewrite 系统规则请勿修改
RewriteRule ^archiver/([a-z0-9\-]+\.html)$ archiver/index.php?$1
RewriteRule ^forum-([0-9]+)-([0-9]+)\.html$ forumdisplay.php?fid=$1&page=$2
RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ viewthread.php?tid=$1&extra=page\%3D$3&page=$2
RewriteRule ^profile-(username|uid)-(.+)\.html$ viewpro.php?$1=$2
RewriteRule ^space-(username|uid)-(.+)\.html$ space.php?$1=$2
</IfModule>
参考http://www.tzlink.com/info/show.php?aid=9081
重启Apache的话,SSH登陆上VPS,然后使用命令 service httpd restart
经过设置,终于把BBS.freeb.cn又恢复了。晚上再把VPS设置下安全。哈。
Linux VPS设置同时支持GBK(GB2312)和UTF-8编码
登陆SSH
到目录/etc/httpd/conf/,找到 httpd.conf
Apache中决定服务器编码的httpd.conf中AddDefaultCharset决定的,我设置为AddDefaultCharset utf-8,所以服务器默认是utf-8的;AddDefaultCharset utf-8上面有一段注释:
# Specify a default charset for all content served; this enables
# interpretation of all content as UTF-8 by default. To use the
# default browser choice (ISO-8859-1), or to allow the META tags
# in HTML content to override this choice, comment out this
# directive:
大概意思是:指定一个默认的字符集传送内容;这将所有内容默认以utf-8编码解析。如果要使用浏览器默认选择(ISO-8859-1),或允许使用HTML的META来自动选择浏览器编码,注释掉这行即可。
那就是改为#AddDefaultCharset utf-8,这样此行不再起作用,浏览器将根据网页的META来选择字符编码,apache就可以支持多字符编码了。
linux虚拟主机伪静态
apache
discuz论坛
新建一个文本文件: new.htaccess 输入以下文字:
<IfModule mod_rewrite.c>
# 将 RewriteEngine 模式打开
RewriteEngine On
# 修改以下语句中的 / 为你的论坛目录地址,如果程序放在bbs中,请将 / 修改为 /bbs
RewriteBase /
# Rewrite 系统规则请勿修改
RewriteRule ^archiver/([a-z0-9\-]+\.html)$ archiver/index.php?$1
RewriteRule ^forum-([0-9]+)-([0-9]+)\.html$ forumdisplay.php?fid=$1&page=$2
RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ viewthread.php?tid=$1&extra=page\%3D$3&page=$2
RewriteRule ^profile-(username|uid)-(.+)\.html$ viewpro.php?$1=$2
RewriteRule ^space-(username|uid)-(.+)\.html$ space.php?$1=$2
</IfModule>
参考http://www.tzlink.com/info/show.php?aid=9081
重启Apache的话,SSH登陆上VPS,然后使用命令 service httpd restart
经过设置,终于把BBS.freeb.cn又恢复了。晚上再把VPS设置下安全。哈。
评论: 0 | 引用: 0 | 查看次数: -
发表评论

上一篇
下一篇

文章来自:
Tags:
相关日志:
