Theres an image on the homepage of my site with the path:
/Images/Advert/advert one.jpg
This has been displaying on the page in the last week, but now the image cannot be found. I've checked the location, and its not been removed. I simply changed the path to:
/Images/Advert/advert-one.jpg
And now the image is found! Why does having a space in the path prevent the browser from finding it?
There are people other than myself who have access to the server, so its possible they have changed a setting, although they believe they haven't, and furthermore I didn't realise such a setting would exist?
URLs cant contain a space. Try replacing the space with %20, e.g. /Images/Advert/advert%20one.jpg
Related
This is probably a dumb question, but I'm worried :
I have published a website on a server, then made some changes to a css file.
As the css file was already cached by my browser, it didn't display the changes.
deleting the cash allowed to display the changes.
Now my worry is that if some users have previously been to the website, and it is cached by their browser, if I make a change they wouldn't be able to see it.
How do you guys prevent this ? Do you just change the file names ?
Sorry for my noobness,
Thanks.
There are a number of solutions floating around the web, but as far as I can tell they all boil down to changing the CSS filenames whenever their content changes. That way you steer clear of user caches and server caches serving old content.
Variants:
Instead of changing the name of the file itself, create a symbolic link with a new name to the old file whenever content changes.
Instead of changing the name of the file, change the way it is referenced by the page. Replacing myfile.css?v=1 by myfile.css?v=2 circumvents people's caches.
Write code that automatically changes the name or the link name or the way the file is referenced
Use a framework that does one of the above.
And: remember that the same problem applies to any content that might be cached, like JS files.
I have a question.
I am currently building a "blog" website. Not that it matters but..
I am trying to set my background to be a specific image that i have.
And it used to work! Until recently and I just don't know why it wont.
It works when i am on my computer, everything works fine.
But i am using 000Webhost as the hoster for the website.
So if u go to "http://pontuslundhblogg.uphero.com/"
You might see that the website is completely white. Cause the picture wont load for the background.
In my css sheet, i am using:
body {
background-image: url("bakgrund.jpg");
And yes, i did name the picture bakgrund.jpg and uploaded it to 000webhost. Its the exact same name etc. I wondering.. Could two different css stylesheets make so it gets weird or something? Cause I added a second css style sheet to be able to have a drop-down menu in a different sheet, and i added the drop-menu. Around that time it started messing with me..
Is it me doing something wrong.
Or is it 000Webhost?
(Might add that none of my pictures is working now, i can also contribute with more code if needed!)
If you go to pontuslundhblogg.uphero.com/bakgrund.jpg you get a message
"The image pontuslundhblogg.uphero.com/bakgrund.jpg cannot be
displayed because it contains errors".
If you go to pontuslundhblogg.uphero.com/bakgrund1.jpg you get 404 page, which means that the first path (bakgrund.jpg) is correct - but the image itself isn't good.
Try to upload it again or contact the hosting service.
If you use FTP maybe you need to change something in your FTP program settings - maybe change from ASCII to Binary transfer.
http://www.inmotionhosting.com/support/website/file-management/corrupt-file-ftp-transfer
I turned on URL rewriting on Drupal, and some URL image are broken.
For example :
local/tw/sites/all/themes/tw/images/1-p1.jpg become
local/tw/content/sites/all/themes/tw/images/1-p1.jpg
or
local/tw/sites/all/themes/tw/images/2-p1.jpg become
local/tw/node/sites/all/themes/tw/images/2-p1.jpg
Any ideas?
If you used relative path, and you're talking about contents within nodes, it's perfectly normal, since "node/" is interpreted like a directory.
You could fix this problem adding a "/" before image src, or using module like Path Filter that provides a simple file:relative/path/to/file syntax.
Friends, i'm stuccoed with images in wordpress - please, help me understand where search for solution.
If you create webpage - www.wordpress.local/page1/01-0001 and you upload an image 01-0001 on that page, you can see, that when you'll visit www.wordpress.local/page1/01-0001, you'll see the page with image, not the page, that you created with text and images.
Any ideas how to solve it ?
PS Not renaming images :)
When you use the WordPress-uploader, the images are stored in /wp-content/uploads/, and WordPress takes care of using filenames that aren't already in use.
If you upload an image, e.g. via FTP, that has the same name as a WordPress-page, the server has to decide what it should serve; either the WordPress-page or the image. One URL = one file served.
In your case, the server decides for the image. You could of course change this configuration; but in all cases, one of the two files won't be accessible.
If you want to make both files accessible, you either need to rename the image or the WordPress-page.
I'm loading a background-image with a url like this:
background-image: url(../../images/folder/imageName.png);
For certain pages, this works fine, but on others, it only works if I put a slash at the front like this:
background-image: url(/../../images/folder/imageName.png);
Its bizarre to me that this would work sometimes and not others. Also, my gut feeling is telling me that starting these urls with a slash is just plain wrong.
Does anyone have any insight on this?
Starting urls without a protocol (http://, etc) means it is relative to the current document. If the different pages are in different folders then the file that relative URL points to will change, which is probably your problem.
Starting a URL with a slash makes it relative to the entire domain/subdomain the page is on. I consider this a good practice so would encourage you to use it.
In your example however you are following it with ../../, which are "directory above" hints, which are ignored because you are already at the base of the domain.
I think I figured it out. My stylesheet is at an address like this:
http://localhost/rootDirectory//pageName/stylesheet.css
Note the two slashes between rootDirectory and pageName. It seems that when my images used the .. to go back directories, it treated the empty space between those slashes as a directory itself (while loading the stylesheet did not treat it as its own directory and had no affect on the path loaded).
So this is why for some stylesheets, ../../ seemd to work, and for others it didn't (as a matter of fact, ../../../ worked instead)