Constructing a URL |
Constructing a URL |
LargeAllen |
Nov 3 2022, 09:22 PM
Post
#1
|
Group: Members Posts: 3 Joined: 3-November 22 Member No.: 28,619 |
I need to construct a URL string when using images or subfiles.
This is really needed so I don't have to input a long string hundreds of times. It only makes sense to just have file names in the body, so when I transition to the host site I only would need to make one string change. |
pandy |
Nov 3 2022, 09:59 PM
Post
#2
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,753 Joined: 9-August 06 Member No.: 6 |
Sorry, I don't understand what you want to do. Can you explain?
|
pandy |
Nov 3 2022, 10:17 PM
Post
#3
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,753 Joined: 9-August 06 Member No.: 6 |
Or wait. Maybe I do understand. Do you mean you want the same URLs to work on your local machine and on the server, when you've uploaded your stuff?
If so use relative URLs. As long as you keep the same file structure they'll work anywhere. https://htmlhelp.com/faq/html/basics.html#relative-url That is if you for example have your HTML files in one folder and inside that folder you have another folder called "images" where you keep all your images you can use URLs like this in the IMG tags. CODE images/picture.jpg |
LargeAllen |
Nov 4 2022, 12:10 PM
Post
#4
|
Group: Members Posts: 3 Joined: 3-November 22 Member No.: 28,619 |
Or wait. Maybe I do understand. Do you mean you want the same URLs to work on your local machine and on the server, when you've uploaded your stuff? If so use relative URLs. As long as you keep the same file structure they'll work anywhere. https://htmlhelp.com/faq/html/basics.html#relative-url That is if you for example have your HTML files in one folder and inside that folder you have another folder called "images" where you keep all your images you can use URLs like this in the IMG tags. CODE images/picture.jpg Do I understand this correctly ? I do the local work on my laptop in the folder c:/myname/website/ Everything is within this folder. When I'm happy with what I see, I transfer it to my website in bulk. Since I use 'relative' url's, it does not matter what the url is of the website, it will simply work. Am I missing anything? |
pandy |
Nov 5 2022, 12:17 AM
Post
#5
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,753 Joined: 9-August 06 Member No.: 6 |
I think you understand it right. Transfer the content of the website folder though, not the whole folder. You don't want a folder named website up there.
|
LargeAllen |
Nov 5 2022, 01:18 PM
Post
#6
|
Group: Members Posts: 3 Joined: 3-November 22 Member No.: 28,619 |
|
pandy |
Nov 5 2022, 02:20 PM
Post
#7
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,753 Joined: 9-August 06 Member No.: 6 |
Good. You're welcome.
|
Lo-Fi Version | Time is now: 26th September 2024 - 07:42 PM |