0

I want to install/use CORS on my Ubuntu server 18.0.4 LTS for the Wordpress websites that I am hosting. Normally I just add the line in the .htaccess but that doesn't seem to work anymore.

Any suggestions are appreciated.

Dave M
  • 4,494
  • 21
  • 30
  • 30

1 Answers1

0

.htaccess is meant for directory level configurations. You should only use that when you are configuring something specific to a directory. The change you are trying to make (define a CORS policy) should be done at the server level. So this is changing the configuration on the Apache web server main config, or config for the site. Both are on the server configuration level.

See here for server specific info: https://enable-cors.org/server.html

Google CORS "webserver type" for web server specific information if the above link does not work. A search for CORS apache for example returned the page above.

DubStep
  • 264
  • 2
  • 8
  • Hey DubStep, Thanks for the reply, I want to use CORS on my Wordpress websites to use the plug-in Elementor Pro. You said in the command that I need to put a code line in the apache.conf file located in /etc/apache2/. What should that code line be and wherein the configuration file of Apache2 can I fill this in? Again thank you in advance – Jeroen den Otter May 10 '20 at 15:47
  • Please guys can someone help?! I have searched everywhere on google but I can't find the working answer. – Jeroen den Otter May 11 '20 at 19:30
  • Amended answer. You can generally find it via google by typing cors and your particular web server version if the particular version isn't mentioned. – DubStep May 18 '20 at 22:50