Why hard-code the base URL (and directory)?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Why hard-code the base URL (and directory)?

Hydrostarr-2
Why does WordPress hard-code the base URL and directory?  (Both are
hard-coded in back-end database.)  Why not leave this up to Apache
mappings in my Linux installs, making all references to paths (either in
URL/web space or filesystem space) relative?  This seems to be how may
other web apps in my server installs do it.

Makes it difficult to port/test/demo installs/sites modularly.  eg, when
demo-ing multiple, independent revs of same site to client, like in:

Details: http://goo.gl/ldbkI

Thoughts?
_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers
Reply | Threaded
Open this post in threaded view
|

Re: Why hard-code the base URL (and directory)?

Robert Lusby
My advice - don't go there. You're about to open a can worms with which
the core developers disagree with a large majority of the community.

Hey - it's there product, not ours I guess.

Rob.

>
> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Hydrostarr
> Sent: 11 March 2012 16:20
> To: [hidden email]
> Subject: [wp-hackers] Why hard-code the base URL (and directory)?
>
> Why does WordPress hard-code the base URL and directory?  (Both are
> hard-coded in back-end database.)  Why not leave this up to Apache
> mappings in my Linux installs, making all references to paths (either in
> URL/web space or filesystem space) relative?  This seems to be how may
> other web apps in my server installs do it.
>
> Makes it difficult to port/test/demo installs/sites modularly.  eg, when
> demo-ing multiple, independent revs of same site to client, like in:
>
> Details: http://goo.gl/ldbkI
>
> Thoughts?
> _______________________________________________
> wp-hackers mailing list
> [hidden email]
> http://lists.automattic.com/mailman/listinfo/wp-hackers

_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers
Reply | Threaded
Open this post in threaded view
|

Re: Why hard-code the base URL (and directory)?

Robert Lusby
On 12/03/2012 09:35, Robert Lusby wrote:
>
> Hey - it's there product, not ours I guess.
>

*their - apologies.

_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers
Reply | Threaded
Open this post in threaded view
|

Re: Why hard-code the base URL (and directory)?

Thomas Belknap
In reply to this post by Robert Lusby
They aren't URLs: they're GUIDs. The URL form just happens to be a
convenient means of creating one.
_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers
Reply | Threaded
Open this post in threaded view
|

Re: Why hard-code the base URL (and directory)?

Braydon Fuller-2
In reply to this post by Hydrostarr-2
Hydrostarr,

To migrate a site from one domain to another, the best way is to search
and replace the domain and take care of it all at once, a script could
easily automate this process:

mysqldump -u youruser -p yourdatabase > database-2012-3-12.sql

sed -i 's/olddomain\.com/newdomain\.com/g' database-2012-3-12.sql

mysql -u youruser -p yourdatabase < database-2012-3-12.sql

-Braydon
_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers
Reply | Threaded
Open this post in threaded view
|

Re: Why hard-code the base URL (and directory)?

Damian Jakusz-Gostomski
In my experience, a simple search and replace will often break parts of the
site, when the URL is within serialized data, and the length of the URL
changes...

To get around this, I recommend the search and replace tool from
InterconnectIT
http://interconnectit.com/124/search-and-replace-for-wordpress-databases



On 12 March 2012 10:00, Braydon <[hidden email]> wrote:

> Hydrostarr,
>
> To migrate a site from one domain to another, the best way is to search
> and replace the domain and take care of it all at once, a script could
> easily automate this process:
>
> mysqldump -u youruser -p yourdatabase > database-2012-3-12.sql
>
> sed -i 's/olddomain\.com/newdomain\.**com/g' database-2012-3-12.sql
>
> mysql -u youruser -p yourdatabase < database-2012-3-12.sql
>
> -Braydon
>
> ______________________________**_________________
> wp-hackers mailing list
> [hidden email].**com <[hidden email]>
> http://lists.automattic.com/**mailman/listinfo/wp-hackers<http://lists.automattic.com/mailman/listinfo/wp-hackers>
>
_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers