Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi I moved a htm file from an incorrect directory then uploaded it. Now the page has lost all its images (just templates) and the text is all wrong. The file that is in the wrong directory looks fine. I need to change it to the correct directory though with all the images and correct text. How can I do this?

When you mioved the file the path to the images changed. Did you enter the path yourself or are you using an HTML editor that created the paths to the images?
If you are using an HTML editor for placing the images you need to go back in and replace the images. If the code was written with a text editor you will need to modify those paths individually.
The fact that the text is wrong makes me believe that the "text" for the page is in an external file as well. Could you provide links tot he old and new pages?
Michael J

I had to input the paths to where the photos were individually and all the images appeared again. Is there anyway of copying a webpage to another location without having to change all the paths?

Yes and no. Depends on the situation. If you are using a robust HTML editor, it should take care of this for you.
However I use text editors. If you are doing the same, then your best option is to include the FULL path to the images instead of just the relative path. For example let's say you have the site "mysite.com" and you have an htm file in the root of the folder. Then you have an images directory in the root as well. Then you *could* make your paths like this:
src="images/imagename.jpg"
But, then if you moved that htm file to a subfolder (say called "contact") then thos image paths would no longer work. The new relative path would be "./images/imagename.jpg". To get around this just use the full path to the images:
src="http://mysite.com/images/imagename.jpg"
Then, no mater where you relocate the htm files they will always point to the images correctly.
The downside to this is that working with these files on your local PC can be a problem unless you run a local web service - since if you run the htm file locally it will look for the images online.
One last option is if you were to use a server side scripting language such as PHP. Then you could create a variable that has the path tot he images directory. This is what I use a lot for code that will be ported to several sites.
Michael J

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |