|
Posted by Rik on 01/25/07 12:51
On Thu, 25 Jan 2007 13:16:45 +0100, wombat <64@k.com> wrote:
> Alright, as I said I'm using the following to create a base to refer t=
o
> whenever I want to use a link to redirect back to the page itself:
>
> $base=3D"http:/"."/".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
>
> I was going to say the problem is coming from using HTTP_HOST but even=
> if I remove that and type the url in by hand, the issue seems to keep
> surfacing around using a subdomain and how someone would enter the pag=
e.
> On one hand when I'm using the editor provided by Yahoo, when I test t=
he
> page out I get one url (1). Then there's another url (2) if I hand typ=
e
> it in using the subdomain, and then a whole other url (3) if I don't.
>
> (1) ***.com/home/index.php
>
> (2) home.***.com
>
> (3) www.***.com/home/index.php
>
> If the only problem was when I was using the editor, that's an easy wo=
rk
> around simply by testing it one way and changing it to work when it's
> finally up, but not everybody will enter the page using the domain and=
> that's where I'm finding the biggest hang up.
Well, why is the base not simply '/'? No problems with different domains=
, =
evrything is relative to the specific domain, and cookies will always be=
=
valid. This would be the preferred way of doing things.
Alternatively, you can force a certain domain on them with a .htaccess =
rewrite. Let's say you want everyone to only use www.example.com:
RewriteCond %{HTTP_HOST} !^www.example.com
RewriteRule .* %{SERVER_PROTOCOL}://www.example.com%{REQUEST_URI} =
[L,R=3D301,QSA]
Seems a lot easier, simpler & reliable then to try to make =
cookies/sessions jump domain :-)
-- =
Rik Wasmus
* I'm testing several new newsreaders at the moment. Please excuse =
possible errors and weird content. *
[Back to original message]
|