1

I have an installation of WordPress in public_html, also I have a folder there containing a crm system.

The problem is that everything works fine but I get an 404 error when trying to load the crm system, specifically the JS and CSS files wont load. PHP works fine.

Here is the main .htaccess in public_html.

Seems like WordPress does not allow me to fetch the files inside the subdirectory and throws 404 errors.

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^wp-admin/includes/ - [F,L]
RewriteRule !^wp-includes/ - [S=3]
RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]
RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]
RewriteRule ^wp-includes/theme-compat/ - [F,L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
Options +FollowSymlinks
</IfModule>

<IfModule Litespeed>
SetEnv noabort 1
</IfModule>

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
  • 2
    You need to use base tag to fix your js and other relative resources. If you are linking js files using a relative path then the file will obviously get a 404 because its looking for URL path . forexample if the URL path is /file/ instead of file.html then your relative resources are loading from /file/ which is not a directory but rewritten html file. To fix this either make your links absolute or use base tag. In the header of your webpage add this `` so that your relative links can load from the correct location. – RavinderSingh13 Jan 13 '21 at 07:08
  • @RavinderSingh13 that does not seem the problem, If I try to fetch the file directly with the URL, I get the same 404 error, from WordPress – whitenoise40 Jan 13 '21 at 07:21
  • Please add some details to the question, what exactly your folder structure looks like, and which files you are trying to request. – CBroe Jan 13 '21 at 07:58

0 Answers0