|
Posted by wombat on 01/25/07 15:33
In article <op.tmpnbxigqnv3q9@misant.kabel.utwente.nl>,
Rik <luiheidsgoeroe@hotmail.com> wrote:
> 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 to
> > whenever I want to use a link to redirect back to the page itself:
> >
> > $base="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 page.
> > On one hand when I'm using the editor provided by Yahoo, when I test the
> > page out I get one url (1). Then there's another url (2) if I hand type
> > 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 work
> > 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=301,QSA]
>
> Seems a lot easier, simpler & reliable then to try to make
> cookies/sessions jump domain :-)
I'll hafta give those a try and see what happens. As far as the base
just being "/", if I remember correctly some time ago I was told that I
should be using "http://......".. especially when using "header".
Navigation:
[Reply to this message]
|