Phalcon Framework Php Htaccess for Apache and CORS Blocked

Teddy ZMel
Mar 19 · 1 min read

.Htaccess file on phalcon index folder :

<”IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ public/ [L]
RewriteRule (.*) public/$1 [L]
<”/IfModule>

.Htaccess file on phalcon public folder :

AddDefaultCharset UTF-8
<”FilesMatch “.(ttf|otf|eot|woff|woff2)$”>
<”IfModule mod_headers.c>
SetEnvIf Origin “http(s)?://(www.)?(google.com|staging.google.com|development.google.com)$" AccessControlAllowOrigin=$0
Header set Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin
Header merge Vary Origin
Header set Access-Control-Allow-Credentials “true”
<”/IfModule>
<”/FilesMatch>
<”IfModule mod_rewrite.c>
SetEnvIf Origin “http(s)?://(www.)?(google.com|staging.google.com|development.google.com)$" AccessControlAllowOrigin=$0
Header set Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin
Header merge Vary Origin
Header set Access-Control-Allow-Credentials “true”
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L]
<”/IfModule>

Teddy ZMel

Written by

vi veri veniversum vivus vici atas kekuatan kebenaran aku, selagi hidup telah menaklukan semesta

More From Medium

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade