|
Posted by Tom on 11/04/06 17:22
I confess I wasn't aware of this problem, but I've never encountered
it. In addition to configuring your server to redirect to one or the
other, you could also try this:
I define the base url as a constant at the beginning of my scripts:
define('MY_BASE_URL', 'http://www.mydomain.com/');
or, if you want to get more dynamic:
define('MY_BASE_URL', 'http://' . $_SERVER['HTTP_HOST'] . '/');
Then whenever you include a link on your page, just use:
<?php echo MY_BASE_URL . 'path/to/file.php'; ?>
Tom
On Oct 26, 4:27 pm, "magic_hat60622" <magic_hat60...@yahoo.com> wrote:
> Hi all. I've got an app that dumps a user id into a session after
> successful login. the login page ishttp://www.mydomain.com/login.php.
>
> If the user visits pages on my site without the www (i.e.,http://mydomain.com/foo.php), the session works fine and login state is
> maintained.
>
> If he visitshttp://www.mydomain.com/foo.php, the app drops the
> logged-in state.
>
> Any idea how to fix this? I'm running php 4.4.1 w/ linux apache.
Navigation:
[Reply to this message]
|