How to avoid 403 error for image URLs in (local) Wordpress via XAMPP on Windows? How to avoid 403 error for image URLs in (local) Wordpress via XAMPP on Windows? wordpress wordpress

How to avoid 403 error for image URLs in (local) Wordpress via XAMPP on Windows?


Your problem is very strange and also very non descriptive . You did not write what version of Xampp you are using , what Version of PHP , what version of Wordpress..

You did not provide details of your folder structure ( where is xampp, where are the images ? different drives ? path ?? NTFS ? FAT ?

You should at least post some sample code of an image that shows and an image that does not show .

But ...Here is a list of things that you might want to check or verify

  • Check that all the related folders has permissions of 755.
  • The above means ALL wp folders (for testings) AND the images folders
  • Check that all your images have legal names for regular php handling (only english characters )
  • check that the images do not have long names .
  • check that the urls do not contain illegal characters
  • Put your images folder (dropbox or not ) INSIDE the xampp httdocsfolder.
  • Better yet - put it inside the wp uploads folder .
  • check your scripts for the server delimiter / or \ (if you copied and pasted the pathes ..)
  • check that the paths do not exceed 256 characters (including the image names)
  • If the dropbox folder is on the dropbox server and not on the local machine (you did not specify that ) than make sure you are using the PUBLIC URL .

The most annoying problem that I have encountered has to do with the point of the english characters . Does the images that DO NOT appear has some umlauts , accents or non ( a-z 0-9 ) characters ?? If they do , try to rename them .

After you will provide some more details , it will be easier to help you pinpoint the problem..

EDIT I

After reading your comment , I believe that all your method of including images is a bit off-course , an not at all realted to xampp or your system´s folder structure / permissions. It seems to me , that you just do not know how to include files in wp themes (but I might be wrong..)

In wordpress, to link theme related images , the images should ideally be located at the theme folder wp-content/themes/your_theme/ or better yet

wp-content/themes/your_theme/img/

then you would just call the images (in your theme) like so :

<img src="<?php echo get_template_directory_uri(); ?>/img/yourimage.jpg" />

look at :get_template_directory_uri()

Alternatively you can look at get_stylesheet_directory_uri() andget_theme_root_uri()

The part where your css images would take a relative part to the css file depends on where you put them in a relative manner . are they in themes/your_theme/img or themes/your_theme/css/img or whatever . at any rate , you call them essentially the same but mind that the images that are called from WITHIN the css will always follow normal rules of css images , not the wordpress one (which is applied to php files) ..

ALL images ( excluding admin ) , as a rule of thumb, should be located under the wp-content folder.

Theme images under themes/your_theme and other images under wp-uploads.

In wp , a path like you described/requested of C:\xampp\htdocs\anneke_00\wp-content\img is non standard , not recommended , and is used only in very extreme cases for very special reasons (surely not for theme display).

If you want , you COULD in theory move your wordpress uploads folder using several methods :

  1. Method A

    • Login into wordpress admin section.
    • Click on settings -> Miscellaneous Settings
    • Apply the file upload folder path.
  2. Method B

as explained in the codex :

define( 'WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/blog/wp-content' ); // in wp-configdefine( 'WP_CONTENT_URL', 'http://example/blog/wp-content'); // in wp-config

or only for uplaods

define( 'UPLOADS', '/wp-content/uploads' );// in wp-config

there are several other methods, but I am sure that with a bit of research you could find them ..

Now , that being said , I am not sure that I understood what you want to achieve , but if it is not some special case for some extreme circumstances of an advanced image handling plugin or something - the problem is not in your images nor in your permissions, it is in your workflow and in how you use theme images in wordpress..


Right clicking on one of the problematic images in Windows Explorer and going to the "Security" tab, what have you got them set to? The account "Everyone" should have the read permission.

Are they images which have been uploaded via the Wordpress media manager?


If you have the time re install XAMPP and WPress it might work, after resatrting windows, this time install XAMPP in c:\apps or d:\apps and make sure that folder is read + write for all

also take care when installing WPREss and XAMPP if they are latest stable and follow the instuctions.

are any of the config files form a unix site? meaning it was on another sytem and now FTPed or copied here?