Htaccess code instead of common meta tags

Will
AddDefaultCharset utf-8
AddType text/html .html .htm

placed in the hataccess file

replace all of
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />

If not, if I use the 2 Add codes above, what do I put in the meta tag?

Thanks,

Chris

C77,

I’d vote for “yes” because you’re making changes to the server … but those changes should be in the httpd.conf (or equivalent) file and NOT in .htaccess.

Regards,

DK

I don’t have access to .conf files. Why is the add codes in the .conf file so important? Why is putting them in htaccess hazardous?

If I use the add codes do I remove all of the meta line ?

Thank DK

C77,

It’s not hazardous. It’s simply a waste of server resources because the conf files are read ONCE and the .htaccess is read multiple times for EVERY file (including embedded support files) which is requested.

There must be a way (up to asking your sys admins) how the server is configured. If it already has these configured then it would be a waste of time to set them. If not (or set in a manner which you don’t approve), by all means set in your .htaccess (or in the html/php files themselves).

Regards

DK

The webhost says to create the httpd.conf file in the home directory. Is there code that has to go in the file in order to be a functioning httpd.conf file?

Once I get the file working do I remove the content type meta tag from the html?

Thanks

C77,

What type of account do you have?

My understanding of hosting tells me that your host has blown smoke up your …

Apache is installed in its own directory and its httpd.conf file is located in its conf subdirectory. Therefore, creating another httpd.conf in your home directory should have exactly no relevance to anything. Of course, your host might have configured your dedicated server to have YOUR personal Apache install look elsewhere for additional directives but I’ve never heard of that being done (that’s not to say that it can’t be done, simply that it’s illogical on a dedicated and can NEVER be done on a shared server).

IMHO, your host’s support should ensure that your code is in your httpd-vhosts file so it can only impact your account’s domains.

After all that, yes, it should be safe to remove those lines from .htaccess.

To me, the simplest solution would be to leave the content type alone (it’s standard) and add the charset directive in your files section in a meta tag.

Regards,

DK

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.