Hazukiy Posted June 19, 2013 Share Posted June 19, 2013 Hi, I have a question that's bugging me really badly, I want to make it so that when I have a <img> tag, the source of that image is shortened to look something like this... <img src="../../image.jpg" alt="picture_1" /> But when I do this, it doesn't work. I've tried many methods and different combination but it doesn't seem to work, so I figured that It must be some kind of option in the apache .htaccess file? Help would be much appreciated, thanks. Quote Link to comment https://forums.phpfreaks.com/topic/279344-shorten-source-directory/ Share on other sites More sharing options...
trq Posted June 19, 2013 Share Posted June 19, 2013 Do you understand what the ../../ does? Quote Link to comment https://forums.phpfreaks.com/topic/279344-shorten-source-directory/#findComment-1436816 Share on other sites More sharing options...
Hazukiy Posted June 19, 2013 Author Share Posted June 19, 2013 Do you understand what the ../../ does? Skips some of the directorys doesn't it? I learnt it a while back but completely forgot about it. Quote Link to comment https://forums.phpfreaks.com/topic/279344-shorten-source-directory/#findComment-1436826 Share on other sites More sharing options...
Solution trq Posted June 19, 2013 Solution Share Posted June 19, 2013 Skips? It ../ goes back up the directory tree one directory from where it is called. ../../ goes back up 2 etc etc So, all this (../../image.jpg) says is go back up two directories (relative to the current url) and find the file image.jpg If you have used any kind of computer from a terminal this type of thing becomes second nature. If you haven't (and your a programmer) do so. Quote Link to comment https://forums.phpfreaks.com/topic/279344-shorten-source-directory/#findComment-1436835 Share on other sites More sharing options...
Hazukiy Posted June 19, 2013 Author Share Posted June 19, 2013 Skips? It ../ goes back up the directory tree one directory from where it is called. ../../ goes back up 2 etc etc So, all this (../../image.jpg) says is go back up two directories (relative to the current url) and find the file image.jpg If you have used any kind of computer from a terminal this type of thing becomes second nature. If you haven't (and your a programmer) do so. Ah ok thanks. Quote Link to comment https://forums.phpfreaks.com/topic/279344-shorten-source-directory/#findComment-1436837 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.