Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2006-03-13 21:57:35
- Gena Wenli
- Member
- From: Ohio, USA
- Registered: 2006-01-26
- Posts: 34
'200 OK's Driving Me Crazy
In my index.php file I have a PHP script that checks for a variable. If the variable isn’t there, it does a header(‘location: etc…. function that sends the browser to another page. The only problem is that Textpattern puts an annoying “200 OK” page there that says “The document has moved here.” How can I bypass this?
G
Offline
Re: '200 OK's Driving Me Crazy
It’s your webserver, not textpattern, that shows that message. Currently you send a 200 and a location header, and the webserver tries to make the best of it.
If you want the webserver to redirct right away, you have to make sure, you send the correct headers together with the location-header, which would be a 302 (temporary), 301 (permanently) or sth. similar. You should be able to find out more about this, by using the search. Within plugins, or other code that runs within textpattern you can use txp_status_header(‘301 Moved Permanently’);
for example to send a 301 Header.
Offline
#3 2006-03-13 23:27:57
- Gena Wenli
- Member
- From: Ohio, USA
- Registered: 2006-01-26
- Posts: 34
Re: '200 OK's Driving Me Crazy
Thanks, adding a 301 header worked. What’s weird though is that it works on just a normal PHP page on my server without the 301, but on any TXP page I have to add the extra bit. Oh well, at least it works! :-P
G
Offline
Pages: 1