Re: Full versus relative URLs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 16, 2009 at 08:49:06PM +0000, Stuart wrote:

> 2009/2/16 Paul M Foster <paulf@xxxxxxxxxxxxxxxxx>:

<snip>

> >
> > 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.
> 
> My advice would be to stop coding and sort this out as soon as
> possible. 

You think? ;-}

> If your development server has a different layout to your
> live server you're simply asking for trouble, especially since you're
> using a front controller pattern (as evidenced in another thread).

Not so much. We've structured our backups and live servers this way for
a number of years without incident. Paqes for clients are normally
statically built in Dreamweaver, with possibly a modicum of PHP to
handle forms. Internal company pages are built by me and reside only on
internal servers. This is the first client project where we're using a
front controller, etc.

> 
> It's simple to fix this. Add a hosts entry for mysite.local pointing
> at pokey's IP. Change the server software so it has a virtual host for
> mysite.local pointed at the mysite.com directory in the existing web
> rooot.

Which works up until the point where you go live with the site, and
forget to revert the hosts file, so you can't get to the live site. And
after you do revert the hosts file, you again have the same problem with
the base URL for the production site being different from the
development/backup site.

Virtual hosting is beyond my Apache expertise, and again, would mask
live sites we host.

In addition, pokey's IP is not exactly fixed. It's served up by DHCP
from an internal DHCP server. It's generally the same, but I wouldn't
want to rely on that in a hosts file.

> 
> This is not difficult and will allow you to solve both of the problems
> you are currently asking this list about.

Actually, Ashley's <base> tag solution resolves the problem. However,
I've moved on and dropped the front controller concept for this project.
Instead, I'm opting for a snippet of PHP at the beginning of every
"static" page built in DW which calls in the values necessary to
populate the sidebars of the pages.

Really, Stuart, you should try not to be so annoyed at people who don't
appear to know as much as you believe you do. ;-}

Paul

-- 
Paul M. Foster

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux