2

I can access my site correctly like www.domain.com ( with all the content loads correctly), but if I type in www.domain.com/pub/ it is still accessible ( without js & css loaded). How do I fix this problem?

I tried to redirect www.domain.com/pub/ to www.domain.com/ but it will also redirect the content in /pub/media to /media. I also tried to put a .htaccess file in /pub directory but didn't work.

Refused to apply style from '<URL>' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
logo.png:1 Failed to load resource: the server responded with a status of 404 (Not Found)
require.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
mixins.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
computer_button.png:1 Failed to load resource: the server responded with a status of 404 (Not Found)
requirejs-config.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
(index):202 Uncaught TypeError: require.config is not a function
    at (index):202
(index):375 Uncaught ReferenceError: requirejs is not defined
    at (index):375
(index):635 Uncaught ReferenceError: requirejs is not defined
    at (index):635
(index):695 Uncaught ReferenceError: requirejs is not defined
    at (index):695
(index):907 Uncaught ReferenceError: requirejs is not defined
    at (index):907
av_button.png:1 Failed to load resource: the server responded with a status of 404 (Not Found)
(index):2689 Uncaught ReferenceError: requirejs is not defined
    at (index):2689
(index):2724 Uncaught TypeError: require is not a function
    at (index):2724
(index):4405 Uncaught ReferenceError: requirejs is not defined
    at (index):4405
(index):4440 Uncaught TypeError: require is not a function
    at (index):4440
(index):4722 Uncaught ReferenceError: requirejs is not defined
    at (index):4722
CE-MT2111-S1.jpg:1 Failed to load resource: the server responded with a status of 404 (Not Found)
USB_Hi-Speed.gif:1 Failed to load resource: the server responded with a status of 404 (Not Found)
hdmi_logo.gif:1 Failed to load resource: the server responded with a status of 404 (Not Found)
logo.png:1 Failed to load resource: the server responded with a status of 404 (Not Found)
payment.gif:1 Failed to load resource: the server responded with a status of 404 (Not Found)
USB_SuperSpeed.png:1 Failed to load resource: the server responded with a status of 404 (Not Found)
digital_signage_logo.gif:1 Failed to load resource: the server responded with a status of 404 (Not Found)
logo-small.png:1 Failed to load resource: the server responded with a status of 404 (Not Found)
  • Why you don't set the pub directory as document root? That would solve your problem and it's recommended to improve the security of your application -> devdocs.magento.com/guides/v2.3/install-gde/tutorials/… – HelgeB May 3 at 6:28
  • i'm trying to follow the setup, but the directory /etc/ only have an empty folder ("www.mydomain.com"), should i create a new folder "apache2" then sub-folder "www.mydomain.com" and create an file "000-default.conf"? – Kris Wen May 3 at 19:25
  • i think the current document root is "/public_html", how should the config look like so it'll serve from "/public_html/pub"? thank you – Kris Wen May 3 at 19:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.