Join the Soledad Facebook Users Group here
for Share, assistance, discussion, and Updates related to Soledad WordPress Theme.

If you can't create a new ticket - you can send us an email via our contact form and we will get back to you.

Okay
  Public Ticket #2747965
Issue with CORS policy
Closed

Comments

  • pship_mkting_2021 started the conversation

    Hello,


    We have used Soledad theme for our blog and we are pleased with it. We installed it at blog.partnership-marketing.net Due to an advice from our SEO specialist, we created a reverse proxy from our main application to show the blog at https://www.partnership-marketing.net/blog Due to this change, we are unable to use the dashboard. When trying to save a post the console shows the following error: 

    Access to fetch at 'https://partnership-marketing.net/blog/wp-json/wp/v2/posts/88?_locale=user' from origin 'https://blog.partnership-marketing.net' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: Redirect is not allowed for a preflight request.

    We tried modifying the htaccess file with the following changes:

    <ifmodule mod_headers.c="">
      <filesmatch ".(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$"="">
        Header set Access-Control-Allow-Origin "*"
      </filesmatch>
    </ifmodule>

    To allow asset resources from another origin.

    And also the following script to allow calls from another origin:

    <ifmodule mod_headers.c="">

       SetEnvIf Origin "^http(s)?://(.+.)?(partnership-marketing.net)$”

     ORIGIN_SUB_DOMAIN=$1

       Header set Access-Control-Allow-Origin "%{ORIGIN_SUB_DOMAIN}e" env=ORIGIN_SUB_DOMAIN

       Header set Access-Control-Allow-Methods: "*"

       Header set Access-Control-Allow-Headers: "Origin, X-Requested-With, Content-Type, Accept, Authorization"

    </ifmodule>

    But the issue persists and we cannot add blog posts.

    Is this something you can help us with?

    Thank you,

    Cristina


  •  2,699
    PenciDesign replied

    Hi,

    Yeah, your config is wrong and it caused the CORS Policy from the browsers. It's not the issue controlled by the theme itself.

    If you want to use the theme on the URL: https://www.partnership-marketing.net/blog/ - I recommend you create a folder called  'blog' on the root folder of website: https://www.partnership-marketing.net/ and install WordPress inside this 'blog' folder.


    Best Regards,

    PenciDesign