如何克服PHP codeIgniter中的MIME类型

时间:2019-05-26 20:18:33

标签: javascript php html codeigniter mime

当其他网站要求时,我正在尝试创建动态html内容。但是它返回MIME类型错误,如何解决此问题

我要执行的过程是将脚本标记共享给用户网站

<script https://www.mywebsite.com/Home/get_html/NDc='></script>

概念是用户必须将此脚本标签嵌入其页脚内容中 并且该网站为“实时”,

userwebsite请求链接以生成

document.write("<div style='position:fixed;z-index:9999999; bottom:2px; left:20px;'><a href='https://www.mywebsite.com/dCertificate/NDc=' target='_blank'><img oncontextmenu='return false;'  src='https://www.mywebsite.com/i

mage / shield / transparent / image_name.png'style ='width:40%'>“);

但是这个像这样返回我的错误 拒绝从“ https://www.mywebiste.com/somewhere/image/NDc=”执行脚本 因为其MIME类型('text / html')不可执行,并且启用了严格的MIME类型检查。

在搜索时,我知道使用.htacess可能已经结束了

但找不到任何缓解剂

这是我的.htacess

RewriteEngine On

RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]

RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^(.*)$ index.php?/$1 [L]
#RewriteRule ^info/(.*)\.php$ Home.php?slot=$1

RewriteCond %{HTTP_HOST} mywebiste.com\.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.mywebiste.com/$1 [R,L]
AuthType Basic
AuthName "Main Site"
AuthUserFile "/home/myweb/.htpasswds/public_html/passwd"
require valid-user

如何处理MIME类型错误。

我发现了这个  How should I create embed code to display my photos on someone else's website?

这表示通过添加Rewirite规则再次解决filename.php的问题,但不幸的是返回了相同的错误

0 个答案:

没有答案