We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

403 error

How Do I?

Claus's avatar
Claus
35 posts
2 months ago
Claus's avatar Claus

Hi,

after modifying a template, I am getting the error on the frontend ‘Directory access is forbidden.’ How can I fix this? I’m running EE 7 on a local XAMPP environment. I wanted to insert an img tag with the image path {base_path}/images/uploads/.

TIA,

Claus

       
Russ K.'s avatar
Russ K.
141 posts
2 months ago
Russ K.'s avatar Russ K.

Hi Claus,

I don’t use XXAMP specifically, but my image links would look like this: {site_url}images/uploads/whatever_my_image_name_is.png

Also, For what it is worth… the structure I use is to keep all of my own content seperate from the EE Directories… at my root level, I have an “Assets” folder and inside of that I have an “images” folder and I point my file upload directory to that. so for me, that link would look like: {site_url}assets/images/whatever_my_image_name_is.png. I think that may help you.

The “Directory Access is Forbidden” message is from the Index.html page in that directory because you are trying to access it directly.

       
Claus's avatar
Claus
35 posts
2 months ago
Claus's avatar Claus

Hi Russ,

you wrote

> … the structure I use is to keep all of my own content seperate from the EE Directories …

I tried that, but EE 7 wouldn’t accept it. I had a separate directory /bilder/uploads/, but I had to delete it again because EE 7 didn’t accept it, like {base_url}/bilder/uploads/.

Claus

       
Russ K.'s avatar
Russ K.
141 posts
2 months ago
Russ K.'s avatar Russ K.

I’m not sure what you mean by “EE wouldn’t accept it”. did you get an error in the control panel when you entered it that said it didn’t exist? If so, try again, but remove the backslash at the beginning.

Also, a couple things… just to be sure I’m understanding your setup… If you look in “Settings” -> URL and Path Settings. Does your {base_url} have a “/” at the end? for example: https://mysite.com/

IF it does…then make a couple changes to your URL….

First… replace “{base_url}. with “{site_url}” - I do not believe that base_url works on the front-end. and then remove the backslash directly after it… so your URL is “{site_url}images/uploads”.

       
Claus's avatar
Claus
35 posts
2 months ago
Claus's avatar Claus

> did you get an error in the control panel …

Yes. Besides that, I will make the modifications you suggested.

Claus

P. S.: I did as you suggested, but now the page is messed up. The style sheets are gone. I replaced {base_url} with {site_url} everywhere on the page. Maybe that was a mistake. :-( Is there a config file where I can fix those errors?

       
Russ K.'s avatar
Russ K.
141 posts
2 months ago
Russ K.'s avatar Russ K.

OK…. just to be clear… in the Control Panel you use {base_url} or {base_path}. on the Site Front-end (in your html) you use {site_url}

R

       
Claus's avatar
Claus
35 posts
2 months ago
Claus's avatar Claus

Ok, thanks, I was able to fix it.

Claus

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.