{"id":529,"date":"2017-02-12T13:18:23","date_gmt":"2017-02-12T13:18:23","guid":{"rendered":"https:\/\/www.xsofthost.com\/help\/?p=529"},"modified":"2021-03-14T12:14:00","modified_gmt":"2021-03-14T12:14:00","slug":"how-to-remove-byte-order-mark-bom-from-php-htaccess-others","status":"publish","type":"post","link":"https:\/\/www.xsofthost.com\/help\/how-to-remove-byte-order-mark-bom-from-php-htaccess-others\/","title":{"rendered":"How to remove Byte order mark from PHP htaccess or others"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"529\" class=\"elementor elementor-529\">\n\t\t\t\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-7b920e9c elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"7b920e9c\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-63a7a5b1\" data-id=\"63a7a5b1\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-3f1ba19 elementor-widget elementor-widget-heading\" data-id=\"3f1ba19\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">What is Byte order mark (BOM)<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-bfc8810 elementor-widget elementor-widget-text-editor\" data-id=\"bfc8810\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\tAccording to W3C definition BOM is  Unicode character encoding  that appear as a magic number at the start of a text file or any other file types. or consider it as  representation for the UTF-8 BOM in ISO-8859-1\n\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-f38a8b7 elementor-widget elementor-widget-heading\" data-id=\"f38a8b7\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Error Case Scenario<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6f45b28 elementor-widget elementor-widget-text-editor\" data-id=\"6f45b28\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Sometimes you may change file using different editor software and upload that file to your website like \u201c.htaccess or php\u201d then on browsing the website you are getting<\/p>\n<p>public_html\/.htaccess: Invalid command \u2018\\xef\\xbb\\xb\u2019, perhaps misspelled or defined by a module not included in the server configuration . Because of this error your website may not work and showing Error 500 . even if you are trying to edit the file in normal editor you wont be able to find out and remove those BOM<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b51ca55 elementor-widget elementor-widget-heading\" data-id=\"b51ca55\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Remove Byte order mark (BOM)<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-1ef7983 elementor-widget elementor-widget-text-editor\" data-id=\"1ef7983\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\tyou can login to your Linux Server using PuTTY SSH and run the following command\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-a9d5653 elementor-widget elementor-widget-code-highlight\" data-id=\"a9d5653\" data-element_type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"prismjs-okaidia copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-bash line-numbers\">\n\t\t\t\t<code readonly=\"true\" class=\"language-bash\">\n\t\t\t\t\t<xmp>vi .htaccess<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-c15a2f5 elementor-widget elementor-widget-text-editor\" data-id=\"c15a2f5\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\tAnd enter the command to remove the BOM:\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-d015800 elementor-widget elementor-widget-code-highlight\" data-id=\"d015800\" data-element_type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"prismjs-okaidia copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-bash line-numbers\">\n\t\t\t\t<code readonly=\"true\" class=\"language-bash\">\n\t\t\t\t\t<xmp>:set nobomb<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-2b90e79 elementor-widget elementor-widget-text-editor\" data-id=\"2b90e79\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\tSave the file:\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-a870205 elementor-widget elementor-widget-code-highlight\" data-id=\"a870205\" data-element_type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"prismjs-okaidia copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-bash line-numbers\">\n\t\t\t\t<code readonly=\"true\" class=\"language-bash\">\n\t\t\t\t\t<xmp>:wq<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-e59f082 elementor-widget elementor-widget-text-editor\" data-id=\"e59f082\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\tAfter running the saving command you can check the file online and the problem should be solved.\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>What is Byte order mark (BOM) According to W3C definition BOM is Unicode character encoding that appear as a magic number at the start of a text file or any other file types. or consider it as representation for the UTF-8 BOM in ISO-8859-1 Error Case Scenario Sometimes you may change file using different editor [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":354,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[31,1,6],"tags":[103,33,7],"_links":{"self":[{"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/posts\/529"}],"collection":[{"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/comments?post=529"}],"version-history":[{"count":11,"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/posts\/529\/revisions"}],"predecessor-version":[{"id":1723,"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/posts\/529\/revisions\/1723"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/media\/354"}],"wp:attachment":[{"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/media?parent=529"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/categories?post=529"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/tags?post=529"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}