The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Constructing a URL
LargeAllen
post 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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Nov 3 2022, 09:59 PM
Post #2


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



Sorry, I don't understand what you want to do. Can you explain?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Nov 3 2022, 10:17 PM
Post #3


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
LargeAllen
post Nov 4 2022, 12:10 PM
Post #4





Group: Members
Posts: 3
Joined: 3-November 22
Member No.: 28,619



QUOTE(pandy @ Nov 3 2022, 10:17 PM) *

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?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Nov 5 2022, 12:17 AM
Post #5


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
LargeAllen
post Nov 5 2022, 01:18 PM
Post #6





Group: Members
Posts: 3
Joined: 3-November 22
Member No.: 28,619



QUOTE(pandy @ Nov 5 2022, 12:17 AM) *

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.


Gotcha! Thanks for your help.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Nov 5 2022, 02:20 PM
Post #7


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



Good. You're welcome. happy.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 16th April 2024 - 09:13 AM