.htaccess Charset Problem...

free web hosting
Open Discussion > CONTRIBUTE > Computers > Programming Languages > PHP Programming

.htaccess Charset Problem...

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

firstly
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
CODE
AddDefaultCharset Big5


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

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


but still not working...
there is something i wondering...
coz my link to the php file is
"foo.php?A=B"
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...

Reply

bjrn
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:
CODE
<?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.

Reply

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

actually the problem is not about the .htaccess dry.gif

QUOTE
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

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.

Recent Queries:-
  1. htaccess charset php - 5.87 hr back. (1)
  2. charset .htaccess - 16.67 hr back. (1)
  3. .htaccess php charset - 38.88 hr back. (1)
  4. htaccess charset - 13.43 hr back. (2)
  5. apache2 charset .htaccess - 44.01 hr back. (1)
  6. php charset .htaccess - 59.62 hr back. (1)
  7. htaccess utf-8 charset mysql - 65.03 hr back. (1)
  8. apache charset htaccess - 89.92 hr back. (1)
  9. php charset - 134.19 hr back. (1)
  10. charset htaccess - 135.49 hr back. (1)
  11. .htaccess utf-8 - 138.86 hr back. (1)
  12. htacces utf8 - 150.10 hr back. (1)
  13. htaccess set charset utf-8 - 185.09 hr back. (1)
  14. .htaccess utf8 - 191.99 hr back. (1)
Similar Topics

Keywords : htaccess, charset, problem

  1. [^] Need Help With Regex (for .htaccess)
    (2)
  2. .htaccess-style Login System And Php
    (13)
    I am trying to make a login system that looks and works like .htaccess using sessions, with a PHP
    script that detects the username used. Let's say I log on with the username "Amezis" and
    correct password. Then I want a PHP (or any other kind of script) to create a cookie or session
    which stores the user name, so it could be possible to store it in a variable as long as the user is
    logged in, and so it can be printed when needed. Basically, this is what I want the script to do:
    CODE /* This file can only be executed after logging in with the htaccess-style login....
  3. .htaccess Redirect Question
    redirect ALL traffic to another domain (6)
    I want to redirect all my traffic from one site to another domain name. Is this possible, and if so,
    would I do something like this: .htaccess code: CODE redirect 302 /
    http://www.mynewdomain.com Thanks!....

    1. Looking for htaccess, charset, problem

*RANDOM STUFF*





*SIMILAR VIDEOS*
Searching Video's for htaccess, charset, problem

*MORE FROM TRAP17.COM*
advertisement



.htaccess Charset Problem...



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute your information that might help someone here.
Ask your Doubts & Queries to get answers.. "Together, We enlight each other!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE