Jump to content
xisto Community
Sign in to follow this  

.htaccess Charset Problem...

Recommended Posts

I have a problem with the charset in my php page...

the whole site included .html and .php didn't automaticly get the right charset i put in the meta content

so I added a .htaccess file

AddDefaultCharset Big5

then it works fine with the .html file extension...
but not my php file...

so i added another line in .htaccess file
AddCharset Big5 .php

but still not working...
there is something i wondering...
coz my link to the php file is
would that be the problem that the .htaccess file dun see it as a normal .php?

Plz help this is annoying me for the whole day...

Share this post

Link to post
Share on other sites

Strange, it looks like you've done the right thing with AddCharset, but since it isn't working perhaps you can add:
AddType 'text/html; charset=Big5' php
to your .htaccess file instead?

Another solution would be to set the following at the beginning of your php documents:

<?php header("Content-Type: text/html; charset=Big5"); ?>
It's important that you do that before sending anything to the client (before any content).

And make sure that you don't have something like: "<meta http-equiv="Content-Type" content="text/html;charset=utf-8">" in the head of your html. THat might screw things up as well.

Share this post

Link to post
Share on other sites

i solved the problem...
i sent a mail to the support of my hosting...

actually the problem is not about the .htaccess :D

We use the CGI version of PHP and some .htaccess changes won't affect PHP files due to the order of processing. So I have removed the .htaccess and moved the AddDefaultCharset Big5 line into the pre loaded Apache configuration for your site.

that what i get from them...
CGI version of PHP... never know about it..

anyway thanx bjrn

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.