Angular Access-Control-Allow-Origin PHP htaccess

Also Read : first love marriage in the world

Angular Access-Control-Allow-Origin PHP htaccess

Today, We want to share with you Angular Access-Control-Allow-Origin PHP htaccess.
In this post we will show you Access-Control-Allow-Origin solution – Angularjs PHP Javascript and htaccess, hear for Access-Control-Allow-Origin solution – Angularjs PHP Javascript we will give you demo and example for implement.
In this post, we will learn about Angular .htaccess – htaccess Access-Control-Allow-Origin with an example.

Access-Control-Allow-Origin stands for other name is CORS (Cross-Origin Resource Sharing) header.

The Access-Control-Allow-Origin Resource Sharing standard works by adding new HTTP headers mean request that allow servers(permitted) to describe the set of origins(all) that are permitted to read(data read) that information using a web browser(chrome,mozila…).

READ :  Laravel Disable Views Cache programmatically Script

It’s one type of Read permitted.

Solution for PHP – Using htaccess Access-Control-Allow-Origin

Error code or Angularjs,Javascript File Request in PHP

// Using Error Javascript File request to the server
			 type: "GET",
			 web_url: "",
			 data: "post_id=" + s_id + "&url_data=" + web_url,
			 dataType: 'json',   
			 cache: false,
			 success: function(data)
				var People_list_data = data[1];              
				var data_list = data[2];           
				$('#maindivid').html("<b>Example of cors: </b>"+People_list_data+"<b><br> Listing data view: </b>"+data_list);

// Using Error Angularjs File request to the server
			error genrated
			//Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at (Reason: CORS header 'Access-Control-Allow-Origin' missing).

Server side code Solution

There just put in file

READ :  C# Anonymous Types Tutorial with Examples

Solution No 1
			 // all permission include this Headers
			 header('Access-Control-Allow-Origin: *');  
			 your code here - respnse code
 Solution No 2
				//  include this Headers with content-type
				 header('content-type: application/json; charset=utf-8');
				 header("access-control-allow-origin: *");


Solution No 3

				// two include this Headers
				header('Content-type: text/html');
				header('Access-Control-Allow-Origin: *');

Solution for htaccess – Using htaccess Access-Control-Allow-Origin

Go to Root Folder and First of all take a backup in htaccess file and past this code in .htaccessfile

Also Read : tamilblasters, 9kmovie, filmygod, hdhub4u, vegamovies, tamilrockers website link and 1377x proxy.

 <IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"


<IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin
    Header set Access-Control-Allow-Credentials true

How to Enable Access-Control-Allow-Origin chrome

please click this link and add the cors chrome extensions and after than send request.

READ :  Angularjs scope vs rootScope objects Example

A Simple requests of client side to server side send Request

A simple Access-Control-Allow-Origin or cross-site request is one that meets all the List of following conditions:

The only allowed methods are:

Using GET Method
Using HEAD Method
Using POST Method

Apart from the headers(CORS) set automatically by the user agent (e.g. Connection, Content-Type,User-Agent, etc.), the only cors(headers) which are allowed to be manually header type set are below:


There are list of allow the Content-Type header are: