Jump to content

SOLVED css file and 403 error


neophron
 Share

Recommended Posts

Hi,

I have an issue with a css file. In my templates folder is an »assets« folder with different subfolders like css, js and img.

I uploaded the latest uikit3 css and js stuff to: assets --> uikit  --> css and js. In my template I'm calling them like this:

<link rel="stylesheet" type="text/css" href="<?php echo $config->urls->templates?>assets/uikit/css/uikit.min.css" />

This gives me an 403 error:
GET http://mysite.com/site/templates/assets/uikit/css/uikit.min.css 403 (Forbidden)

If I change the path to: <link rel="stylesheet" type="text/css" href="<?php echo $config->urls->templates?>assets/css/uikit.min.css" />
everything is fine.

Is this a logic behavior from Processwire?

Link to comment
Share on other sites

Hi @neophron,

Just some thoughts to find the cause of this behaviour.

  • Do you have full control over the PW installation? Does the folder ../templates/assets and all the files within have the same ownership and rights as the containing folder (or any other folder)? I ask because this is not a standard folder and it was created specially at some point.
  • Also, you might want to check your .htaccess file in the site root folder. Is there a rule which prevents the access?

Hope this helps for a start.

  • Like 1
Link to comment
Share on other sites

Sorry, my answer above was probably not very helpful. I am actually not sure if I understand your question or reasoning.

You refer to two different options

Quote

 

<link rel="stylesheet" type="text/css" href="<?php echo $config->urls->templates?>assets/uikit/css/uikit.min.css" />

<link rel="stylesheet" type="text/css" href="<?php echo $config->urls->templates?>assets/css/uikit.min.css" />

 

How do the two options render in your browser?

<link rel="stylesheet" type="text/css" href="/site/templates/assets/uikit/css/uikit.min.css" />  - does not work?

<link rel="stylesheet" type="text/css" href="/site/templates/assets/css/uikit.min.css" /> - works?

So probably if the following does not work

http://mysite.com/site/templates/assets/uikit/css/uikit.min.css

Does the following link then work?

http://mysite.com/site/templates/assets/css/uikit.min.css

Just wondering if the uikit.min.css is rather located in the folder /site/templates/assets/css/ and the folder /site/templates/assets/uikit does not actually exist?

According to my understanding of PW, the default settings in the .htaccess file only direct requests to php and other system files to PW root index.php whereas files like .css or .js are handled by the web server directly.

Maybe someone more knowledgeable can answer this question.

 

  • Like 1
Link to comment
Share on other sites

Hi,

thanks for your suggestions. I solved it.

The problems was, that I created this new folder in a different way (with Transmit [a ftp tool for Mac] and a mounted ftp folder). And it could be an issue with the ownership rights.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...