如何让apache 服务器发出的网页编码为 gb2312 ?

dbfan 2003-08-06 10:34:50
我设置了
AddDefaultCharset GB2312 但是没有用?

谁能帮帮忙?
...全文
351 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
sherryji 2003-08-30
  • 打赏
  • 举报
回复
可能是网页的文字问题,添加一句话在每个网页的lt;headgt;lt;/headgt;里加入这行:

lt;meta http-equiv="Content-Type" content="text/html; charset=gb2312"gt;

一般的中文版网页编辑工具(例如FrontPage、Dreamweaver等)都会自动加上这行。
ashchen 2003-08-30
  • 打赏
  • 举报
回复
天哪,这样的问题还有人再问啊?真是...长江后浪推前浪...........
windylu 2003-08-28
  • 打赏
  • 举报
回复
这个就是Apache默认的存放webpage的目录啊,如果在编译的时候没指定,则默认在/usr/local/apache2/htdocs,如果在windows下,就是你安装apache的目录啊,比如c:\apache group\apahce2\htdocs,你不会连它装在什么都不知道吧:)
Josh_li 2003-08-27
  • 打赏
  • 举报
回复
redbugler(红色号手) :你的这个目录%home%:\Apache Group\Apache2\htdocs
我怎么没有
再次超越梦想 2003-08-26
  • 打赏
  • 举报
回复
哈哈,我这有个笨办法。可以看看%home%:\Apache Group\Apache2\htdocs里面是怎么安排的。这个文件最重要:index.html.var,可以看看里面,它定义了多种编码。如果你的页面是简体中文的,就要命名为:index.html.zh-cn.gb2312,繁体中文就要命名为:index.html.zh-tw.big5,这里面不用指定编码。这样就可以了,会自动打开相应的页面。等熟悉了以后,可以自己改改配置文件。
jackyrong 2003-08-26
  • 打赏
  • 举报
回复
我在LINUX下也是这个情况,重装了LINUX都不行
rkongjian 2003-08-13
  • 打赏
  • 举报
回复
建议注掉缺省语言和字符集设置,改在网页中指定
c_hook 2003-08-06
  • 打赏
  • 举报
回复
全补贴给你,还是不行啊!!!!
ServerType standalone
ServerRoot "D:\oracle\ora81\Apache\Apache"
PidFile logs\httpd.pid
ScoreBoardFile logs\httpd.scoreboard
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MaxRequestsPerChild 0
ThreadsPerChild 50
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestsPerChild 0
#Listen 3000
Listen 10.18.3.124:80
BindAddress 10.18.3.124
# LoadModule foo_module libexec/mod_foo.dll
LoadModule mime_magic_module modules/ApacheModuleMimeMagic.dll
LoadModule anon_auth_module modules/ApacheModuleAuthAnon.dll
LoadModule cern_meta_module modules/ApacheModuleCERNMeta.dll
LoadModule digest_module modules/ApacheModuleDigest.dll
LoadModule expires_module modules/ApacheModuleExpires.dll
LoadModule headers_module modules/ApacheModuleHeaders.dll
LoadModule proxy_module modules/ApacheModuleProxy.dll
LoadModule rewrite_module modules/ApacheModuleRewrite.dll
LoadModule speling_module modules/ApacheModuleSpeling.dll
LoadModule status_module modules/ApacheModuleStatus.dll
LoadModule usertrack_module modules/ApacheModuleUserTrack.dll
LoadModule perl_module modules\ApacheModulePerl.DLL
LoadModule ssl_module modules\ApacheModuleSSL.DLL
ClearModuleList
AddModule mod_mime_magic.c
AddModule mod_env.c
AddModule mod_log_config.c
AddModule mod_mime.c
AddModule mod_negotiation.c
AddModule mod_rewrite.c
AddModule mod_speling.c
AddModule mod_status.c
AddModule mod_include.c
AddModule mod_autoindex.c
AddModule mod_dir.c
AddModule mod_cgi.c
AddModule mod_asis.c
AddModule mod_imap.c
AddModule mod_actions.c
AddModule mod_userdir.c
AddModule mod_alias.c
AddModule mod_access.c
AddModule mod_auth.c
AddModule mod_so.c
AddModule mod_setenvif.c
AddModule mod_auth_anon.c
AddModule mod_cern_meta.c
AddModule mod_digest.c
AddModule mod_expires.c
AddModule mod_headers.c
AddModule mod_proxy.c
AddModule mod_usertrack.c
AddModule mod_perl.c
AddModule mod_ssl.c
ExtendedStatus On
Port 80
#Listen 80
Listen 10.18.3.124:443
ServerAdmin you@your.address
ServerName http://10.18.3.124
DocumentRoot "E:\htdocs"
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory "E:\htdocs">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
UserDir "D:\oracle\ora81\Apache\Apache\users\"
DirectoryIndex index.html index.jsp
AccessFileName .htaccess
<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>
UseCanonicalName On
TypesConfig conf\mime.types
DefaultType text/plain
<IfModule mod_mime_magic.c>
MIMEMagicFile conf\magic
</IfModule>
HostnameLookups Off
ErrorLog logs\error_log
LogLevel warn
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
CustomLog logs\access_log common
ServerSignature On
Alias /icons/ "D:\oracle\ora81\Apache\Apache\icons/"
Alias /jservdocs/ "D:\oracle\ora81\Apache\Jserv\docs/"
ScriptAlias /cgi-bin/ "D:\oracle\ora81\Apache\Apache\cgi-bin/"
<Directory "D:\oracle\ora81\Apache\Apache\cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>

#
# Redirect allows you to tell clients about documents which used to exist in
# your server's namespace, but do not anymore. This allows you to tell the
# clients where to look for the relocated document.
# Format: Redirect old-URI new-URL
#

#
# Directives controlling the display of server-generated directory listings.
#

#
# FancyIndexing is whether you want fancy directory indexing or standard
#
IndexOptions FancyIndexing
AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip

AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType (SND,/icons/sound2.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*

AddIcon /icons/binary.gif .bin .exe
AddIcon /icons/binhex.gif .hqx
AddIcon /icons/tar.gif .tar
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
AddIcon /icons/a.gif .ps .ai .eps
AddIcon /icons/layout.gif .html .shtml .htm .pdf
AddIcon /icons/text.gif .txt
AddIcon /icons/c.gif .c
AddIcon /icons/p.gif .pl .py
AddIcon /icons/f.gif .for
AddIcon /icons/dvi.gif .dvi
AddIcon /icons/uuencoded.gif .uu
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
AddIcon /icons/tex.gif .tex
AddIcon /icons/bomb.gif core

AddIcon /icons/back.gif ..
AddIcon /icons/hand.right.gif README
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/blank.gif ^^BLANKICON^^
DefaultIcon /icons/unknown.gif
ReadmeName README
HeaderName HEADER
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
AddEncoding x-compress Z
AddEncoding x-gzip gz tgz
AddLanguage en .en
AddLanguage fr .fr
AddLanguage de .de
AddLanguage da .da
AddLanguage el .el
AddLanguage it .it
AddLanguage zh-cn .cn
LanguagePriority cn en fr de

AddCharset GB2312 .gb2312 .gb
DefaultLanguage GB2312

AddDefaultCharset gb2312
AddType application/x-tar .tgz
BrowserMatch "Mozilla/2" nokeepalive
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
BrowserMatch "RealPlayer 4\.0" force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0
<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from localhost jzx
</Location>
<VirtualHost 10.18.3.124>
ServerAdmin webmaster@host.some_domain.com
DocumentRoot e:\htdocs
ServerName 10.18.3.124
ErrorLog logs/www_error_log
CustomLog logs/www_access_log common
</VirtualHost>
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl


<IfModule mod_ssl.c>
SSLPassPhraseDialog builtin
SSLSessionCache dbm:logs\ssl_scache
SSLSessionCacheTimeout 300
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
SSLLog logs/ssl_engine_log
SSLLogLevel warn
</IfModule>
<VirtualHost _default_:443>
DocumentRoot "D:\oracle\ora81\Apache\Apache\htdocs"
ServerName jzx
ServerAdmin you@your.address
ErrorLog logs/error_log
TransferLog logs/access_log
SSLEngine on
SSLCertificateFile \conf\ssl.crt\server.crt
SSLCertificateKeyFile conf\ssl.key\server.key
<Files ~ "\.(cgi|shtml)$">
SSLOptions +StdEnvVars
</Files>
<Directory "cgi-bin">
SSLOptions +StdEnvVars
</Directory>
CustomLog logs/ssl_request_log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

</VirtualHost>
Alias /perl/ "D:\oracle\ora81\Apache\Apache/cgi-bin/"
PerlModule Apache::Registry
<Location /perl>
SetHandler perl-script
PerlHandler Apache::Registry
AddHandler perl-script .pl
Options +ExecCGI
PerlSendHeader On
</Location>
include "D:\oracle\ora81\Apache\Jserv\conf\jserv.conf"
include "D:\oracle\ora81\Apache\Apache\conf\oracle_apache.conf"
yophoo 2003-08-06
  • 打赏
  • 举报
回复
应该不会,这样就可以!
c_hook 2003-08-06
  • 打赏
  • 举报
回复
楼上,还是不管用啊!!!
AddLanguage en .en
AddLanguage fr .fr
AddLanguage de .de
AddLanguage da .da
AddLanguage el .el
AddLanguage it .it
AddLanguage zh-cn .cn

LanguagePriority cn en fr de

DefaultLanguage GB2312
AddCharset GB2312 .gb2312 .gb
AddDefaultCharset gb2312
这样子都不管用啊??????!!!!!!!
indeed 2003-08-06
  • 打赏
  • 举报
回复
DefaultLanguage GB2312
AddLanguage zh-cn .cn

这样试试,记得要重启服务呦.......
myblessu 2003-08-06
  • 打赏
  • 举报
回复
那应该是IE的缓存的问题,你先清空IE的缓存.在另建一个不同名的页面,或那你那页面改名后在在IE里看,就可以了.

24,922

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Apache
社区管理员
  • Apache
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧