Re: Full versus relative URLs
| From: | Paul M Foster | Date: | Mon, 16 Feb 2009 19:51:28 +0000 |
| Subject: | Re: Full versus relative URLs | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-288359@lists.php.net to get a copy of this message | ||
On Mon, Feb 16, 2009 at 08:09:51PM +0200, Dotan Cohen wrote:
> > Agreed. But here's the real reason, in my case. We develop the pages on
> > an internal server, which has the URL
> > http://pokey/mysite.com. When we
> > move the pages to the live server at mysite.com, all the URLs would have
> > to be rewritten. Ugh.
> >
> > Paul
> >
>
> So put it all in one place:
>
> <?php
> include "path.inc";
> print"<a href=\"$path/dir/file.php\">";
> ?>
>
> Full URLs don't break when users save the pages to disk.
That would be fine if the pages weren't being crafted in Dreamweaver,
where inserting links like that is a pain.
Paul
--
Paul M. Foster