[wp-hackers] Why always absolute paths?

Stas Sușcov stas at nerd.ro
Wed Apr 21 13:12:14 UTC 2010


În data de Mi, 21-04-2010 la 07:58 -0500, Stephen Rider a scris:
> On Apr 21, 2010, at 6:46 AM, Bumbu Alex wrote:
> 
> > if you use sef url and you'll give relative path for the image (ex.
> > images/top.jpg)
> > 
> > so on page _http://page.com/ you'll have src to _
> > http://page.com/images/top.jpg
> 
> Correct.
> 
> > you can use such src as /images/top.jpg and for the above examples you'll
> > have tha same link _http://page.com/images/top.jpg
> > but when somebody will have WP installed in subdirectory, but he will use
> > default template, instead of getting
> > _http://page.com/blog/images/top.jpg
> > he will have
> > _http://page.com/images/top.jpg
> 
> ???  If WP is installed in a subdirectory, the root path would include the subdirectory.  I still don't see the problem with root paths.
> 
> I've wondered this myself regarding links to media put on a site with the uploader.  Why full URL with the path?  If I move domains or something I have to go into the database and change the URLs for all those links.
> 
> Stephen
> 

Didn't study in depth the cause, but I think saving media files uri in
db helps a lot writing plugins for cdn plugins. This is an issue, but
it's not wrong at all.

-- 
()  Campania Panglicii în ASCII
/\  http://stas.nerd.ro/ascii/



More information about the wp-hackers mailing list