Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Prestashop for CORS petitions using .htaccess #8

Closed
amoncusir opened this issue Sep 12, 2019 · 3 comments
Closed

Enable Prestashop for CORS petitions using .htaccess #8

amoncusir opened this issue Sep 12, 2019 · 3 comments

Comments

@amoncusir
Copy link

Hi!

I send this issue for show how enable CORS without modify Prestashop code using a .htaccess file. In this way only works with Apache HTTP server and miss configurations for others HTTP servers, like Nginx.

My prupose is for add this script in the main README and help other users when working with SPA and need enable CORS.

Thank's for your project!

PD. Sorry for mi english!

<IfModule mod_headers.c>
   Header always set Access-Control-Allow-Origin "*"
   Header always set Access-Control-Allow-Headers "Content-Type, Authorization, Io-Format, Accept"
   Header always set Access-Control-Allow-Methods "GET,POST,HEAD,DELETE,PUT,OPTIONS"
</IfModule>

<IfModule mod_rewrite.c>
  # Added a rewrite to respond with a 200 SUCCESS on every OPTIONS request
  RewriteEngine On
  RewriteCond %{REQUEST_METHOD} OPTIONS
  RewriteRule ^(.*)$ $1 [R=200,L]
</IfModule>
@SKaDiZZ
Copy link
Owner

SKaDiZZ commented Nov 30, 2019

Thank you for your contribution I'll add your example into readme file.

@SKaDiZZ SKaDiZZ closed this as completed Nov 30, 2019
@amoncusir
Copy link
Author

You're welcome! Only one thing, this example is for Apache, not Nginx! 😆

@SKaDiZZ
Copy link
Owner

SKaDiZZ commented Dec 5, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants