Headers already sent problem
Posted: Sat Mar 19, 2005 4:25 am
Hi,
I know this sort of error comes up all the time, but each situation from browsing this forum seems to have unique circumstances and solutions.
My 'property' page is a single script that generates an output page dependent upon any information after the script name, e.g.
property/region
or
property/region/location
or
property/region/location/type35
I detect the contents after the property/.... by using $_SERVER['REQUEST_URI'] and then explode('/', ...) etc.
I do this because, as I am using shared hosting, mod_rewrite is disabled and therefore I have to use this method to create keyword meaningful URLs.
I want to change this URL form however to
property/region
or
property/region.location
or
property/region.location.type35
I know how to do this. However, I don't want Google to come across my site and spider broken URLs - I want the original form of the URLs to be redirected with the permenantly moved header to the new type. So, for example
property/region/location
would be permenantly redirected to
property/region.location
Where property/region.location would then contain the code originally contained in property/region/location.
The problem I'm having is that I'm trying to use
to redirect where the script detects the property/region/location URL form, but i'm getting the age-old error:
I've had a search of the forum for this particular scenario, and I can't see it specifically referred to. Can anyone give any suggestions as to what to do?
I hope that sufficiently explains the problem
Many thanks
Mark
I know this sort of error comes up all the time, but each situation from browsing this forum seems to have unique circumstances and solutions.
My 'property' page is a single script that generates an output page dependent upon any information after the script name, e.g.
property/region
or
property/region/location
or
property/region/location/type35
I detect the contents after the property/.... by using $_SERVER['REQUEST_URI'] and then explode('/', ...) etc.
I do this because, as I am using shared hosting, mod_rewrite is disabled and therefore I have to use this method to create keyword meaningful URLs.
I want to change this URL form however to
property/region
or
property/region.location
or
property/region.location.type35
I know how to do this. However, I don't want Google to come across my site and spider broken URLs - I want the original form of the URLs to be redirected with the permenantly moved header to the new type. So, for example
property/region/location
would be permenantly redirected to
property/region.location
Where property/region.location would then contain the code originally contained in property/region/location.
The problem I'm having is that I'm trying to use
Code: Select all
header("e;HTTP/1.1 301 Moved Permanently"e;);
header("e;Location: http://www.mysite.biz/property/region.location"e;);
header("e;Connection: close"e;);Code: Select all
Warning: Cannot modify header information - headers already sent by (output started at /home/xxxx/public_html/property2:1309) in /home/xxxx/public_html/property2 on line 1321 Warning: Cannot modify header information - headers already sent by (output started at /home/xxxx/public_html/property2:1309) in /home/xxxx/public_html/property2 on line 1322 Warning: Cannot modify header information - headers already sent by (output started at /home/xxxx/public_html/property2:1309) in /home/xxxx/public_html/property2 on line 1323I hope that sufficiently explains the problem
Many thanks
Mark