Personal computing discussed

Moderators: renee, SecretSquirrel, just brew it!

 
Crayon Shin Chan
Minister of Gerbil Affairs
Topic Author
Posts: 2313
Joined: Fri Sep 06, 2002 11:14 am
Location: Malaysia
Contact:

Site linking in a portable manner:

Tue Feb 24, 2009 6:45 am

My host, which happens to host my blog for free, has quite a couple of domains. Last time, ikimashou.net was bought over by a squatter, and even though my blog was still running at dasaku.net, the image and resource links all pointed to files on ikimashou.net. I've thought a bit about changing all the links in my blogposts to /wp-content/uploads/(date) instead of http://ritchan.dasaku.net/wp-content/uploads/(date) so that in case dasaku.net is unavailable or I wish to move my content elsewhere, I won't be dependent on a single host.

Is this good practice, or is there another way? Because I imported the posts to my local XAMPP installation, and whenever I use the relative path /wp-content/uploads/(date), it forgets that it's actually at http://localhost/wordpress/ instead of http://localhost... thus breaking it again. Any fixes?

Also, is there a quick and easy way to go through my year's worth of posts and replace all the links?
Mothership: FX-8350, 12GB DDR3, M5A99X EVO, MSI GTX 1070 Sea Hawk, Crucial MX500 500GB
Supply ship: [email protected], 12GB DDR3, M4A88TD-V EVO/USB3
Corsair: Thinkpad X230
 
Master Kenobi
Gerbil First Class
Posts: 127
Joined: Wed Aug 15, 2007 9:08 am

Re: Site linking in a portable manner:

Tue Feb 24, 2009 7:48 am

For any web code you really dont want to be using hard links with domain names in them, unless your linking to an external source. If its part of your website use the paths according to the arrangement on the FTP server. I'm not sure I fully understand what your doing with the XAMPP local install. All the website files should be on your FTP server, unless your hosting this locally?
i7-6700k @ 4.00GHz | Gigabyte Gaming-5 | GTX 980 4GB | 4x8 (32GB) DDR4-2400 Corsair Vengeance LPX | Windows 10 Pro x64 | 1x 1TB Samsung EVO SSD | 1x 3TB WD Green HDD
 
steelcity_ballin
Gerbilus Supremus
Posts: 12072
Joined: Mon May 26, 2003 5:55 am
Location: Pittsburgh PA

Re: Site linking in a portable manner:

Tue Feb 24, 2009 7:52 am

It sounds like you are having a pathing issue between your development locally and your deployment remotely given your last few sentences. I haven't used wordpress at all so take that for what it's worth, but if the folder structure is the same locally and remotely, you should be able to access any files using a relative path. Absolute pathing should be used sparingly because it causes too many problems with file management, scalability, updating etc.

Could you better explain the relationship between the ikimashou.net domain and the ritchan.dasuku.net domain?
 
Crayon Shin Chan
Minister of Gerbil Affairs
Topic Author
Posts: 2313
Joined: Fri Sep 06, 2002 11:14 am
Location: Malaysia
Contact:

Re: Site linking in a portable manner:

Tue Feb 24, 2009 8:37 am

ikimashou.net and dasaku.net are different pages, but ritchan.dasaku.net is just the same as ritchan.ikimashou.net.

As for the XAMPP install, what I meant was for ritchan.dasaku.net, the root folder in that case was htdocs/wordpress, so when I FTP in, I go straight to the directory which contains Wordpress's files. For my local XAMPP installation, the root folder is htdocs. Thus, when I pass a relative link in my XAMPP installation, it looks in htdocs/wp-content instead of htdocs/wordpress/wp-content. I was hoping there's a function to return a link relative to Wordpress's installation folder, not relative to whatever the web server specifies (in this case, htdocs/)
Mothership: FX-8350, 12GB DDR3, M5A99X EVO, MSI GTX 1070 Sea Hawk, Crucial MX500 500GB
Supply ship: [email protected], 12GB DDR3, M4A88TD-V EVO/USB3
Corsair: Thinkpad X230

Who is online

Users browsing this forum: No registered users and 1 guest
GZIP: On