Relative paths or fixed paths?

Relative paths or fixed paths?

  • Relative

    Votes: 8 100.0%
  • Fixed

    Votes: 0 0.0%

  • Total voters
    8

tnl2k7

Banned
Messages
3,131
Reaction score
0
Points
0
Just wondering if you prefer to use relative paths or fixed paths when designing websites, and whether you use fixed paths in PHP for includes/requires/fopens and stuff. It came to me when I was trying to move WordPress on my test PC to my x10Hosting account and discovered it uses fixed paths for everything :hahano:. I'm just gonna do a resinstall and put a few useful posts up, my blog was abandoned and full of crap anyway lol.

But anyway, relative or fixed paths?

I tend to use relative paths where possible because it's easier to move something around. If I need to use fixed ones, I have a variable somewhere which is easy to change and means I get the benefits of using relative ones.

-Luke.
 
Last edited:

Anna

I am just me
Staff member
Messages
11,752
Reaction score
581
Points
113
I'd say relative as well, for the flexibility. Nothing breaks if I change addy

btw, for the wordpress stuff, it's easy to change, as it is actually stored in database as a variable (you set it in admin area stupid enough, blog url and homepage url). However you can edit it through phpmyadmin, in settings table there are two rows that handle the url of the blog. You need to change them both.
 
Last edited:

Smith6612

I ate all of the x10Pizza
Community Support
Messages
6,517
Reaction score
48
Points
48
I use relative paths. I've found it to be less of a hassle down the road when working with my websites. The only time I need to change a relative path is when I mass move content around.
 

tnl2k7

Banned
Messages
3,131
Reaction score
0
Points
0
I'd say relative as well, for the flexibility. Nothing breaks if I change addy

btw, for the wordpress stuff, it's easy to change, as it is actually stored in database as a variable (you set it in admin area stupid enough, blog url and homepage url). However you can edit it through phpmyadmin, in settings table there are two rows that handle the url of the blog. You need to change them both.

Yes, but once you've changed that, any references to uploaded images are broken because they're fixed too. WordPress is an amazing software, but this is one thing that lets it down in my book. I've fixed it anyway, the site's back up with a new skin and some posts. Luckily there wasn't much in my old blog, most of it was announcements about issues with the arcade anyway. I just copied the 2 useful ones lol =P.

-Luke.
 

allinone

New Member
Messages
227
Reaction score
0
Points
0
relative paths are always preferred bcoz you never know if there will be any changes on your directory, server, or the pale where data is placed
 

xav0989

Community Public Relation
Community Support
Messages
4,467
Reaction score
95
Points
0
I always try to use relative paths instead of fixed paths to be able to move the root folder of place in another folder. I even created a script to modify the relative path when the include script is in a root folder and needs to get scripts in other folders, children and parent.
 

chappill

New Member
Messages
74
Reaction score
0
Points
0
Definitely got to be relative, if I have to move host for whatever reason unless I use the same user name I'm stuffed, with over 400 files editing all the path files would be a right pain in the bum.
 

jazzencat

New Member
Messages
19
Reaction score
0
Points
0
this was in HTML, but I usually used relative paths for the links to pages within my site and fixed only when linking to external sites. This meant that I could pull and save the entire site with layout on my computer and test it out before uploading it. Very useful when you are working with dial-up and limited hours per month of access.
 

TheMan177

New Member
Messages
179
Reaction score
0
Points
0
Relative paths, but if I must use fixed in a project it will be stored in a variable in one location - easy to change if need be.
 

cowctcat

New Member
Messages
401
Reaction score
0
Points
0
Well if im desining a site for someone i will try to use fixed paths just to smite them. hahaha. some times tey even pay you to fix your own bugs. where am i getting that crap from. I try to use reletive for my own things because why smite myself
 
Top