0
amさんはangular2アプリケーションを購入し、共有ホスティングでphpバックエンドをホストしました。私は、POSTリクエストを送信するたびに は私の地元のXAMPPでapache headers_module in.htaccessを有効にする
No 'Access-Control-Allow-Origin' header is present on the requested resource
のエラーを取得しています私はこの問題を解決するためのapacheでheaders_moduleを有効にする必要がありました、アイブ氏は、共有ホスティング会社に連絡し、彼らはモジュールを有効カント
これは、現在の.htaccessファイルでどのように私は、.htaccessファイルで、おそらくこの周りに行くことができRewriteEngine on
# hide files and folders
RedirectMatch 404 /_protected
RedirectMatch 404 /\.git
RedirectMatch 404 /composer\.
RedirectMatch 404 /.bowerrc
# If a directory or a file exists, use the request directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Otherwise forward the request to index.php
RewriteRule . index.php
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Headers "Content-Type"
W帽子私は、このエラーのため、あるいはいいえ、あなたはモジュールをロードするために.htaccess
を使用することはできません
headers_module
また、yii2でヘッダーを設定しましたが、エラーが返されました。要求されたリソースに「アクセス制御許可の原点」ヘッダーがありません –