how do I get .osp to work

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

adneg
Forum Newbie
Posts: 13
Joined: Wed May 21, 2003 11:20 am

how do I get .osp to work

Post by adneg »

I finally got thing working php,mysql and apache. unzipped my website which was designed by a website design company and now I am haveing a problem.

The index.php runs this:

<?php header("Location: http://fletcher.co.uk/site/site.php/hom ... newsession"); ?>

i added this to my http.conf
AddType application/x-httpd-php .php .osp

and still no joy.

I had this working under an earlier version.
User avatar
cactus
Forum Regular
Posts: 343
Joined: Tue Jun 10, 2003 4:16 am
Location: UK

Post by cactus »

Place a space between the the word "Location" and the : as below:

Code: Select all

<?php header("Location : http://fletcher.co.uk/site/site.php/hom ... newsession"); ?>
Also, did you restart Apache after adding the new file extension ?

Regards,
adneg
Forum Newbie
Posts: 13
Joined: Wed May 21, 2003 11:20 am

Post by adneg »

I placed a space where you said and that gives me the error the document has no data.

Yes I did stop and start apache.

I am running apache 2.0.44 and php 4.2.3
User avatar
cactus
Forum Regular
Posts: 343
Joined: Tue Jun 10, 2003 4:16 am
Location: UK

Post by cactus »

I'm a little confused with your header loaction, you seem to be mixing paths and params in the URL, is "/home/index.osp?newsession" a parameter to "site.php" ?

Regards,
adneg
Forum Newbie
Posts: 13
Joined: Wed May 21, 2003 11:20 am

Post by adneg »

I asked the developer the same question and this was the reply

http://www.fletcher.co.uk/site/site.php
is the script
/home/index.osp?newsession
is the query string - which is a bit unusual, so i can see why
you're puzzled...


If this mean anything to you, I have difficulty understanding the query and why they did it like this.
What I do know is that the php code is being read.
[]InTeR[]
Forum Regular
Posts: 416
Joined: Thu Apr 24, 2003 6:51 am
Location: The Netherlands

Post by []InTeR[] »

cactus wrote:Place a space between the the word "Location" and the : as below:

Code: Select all

<?php header("Location : http://fletcher.co.uk/site/site.php/hom ... newsession"); ?>
There should be no space at all....
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html wrote:14.30 Location
The Location response-header field is used to redirect the recipient to a location other than the Request-URI for completion of the request or identification of a new resource. For 201 (Created) responses, the Location is that of the new resource which was created by the request. For 3xx responses, the location SHOULD indicate the server's preferred URI for automatic redirection to the resource. The field value consists of a single absolute URI.

Location = "Location" ":" absoluteURI

An example is:

Location: http://www.w3.org/pub/WWW/People.html

Note: The Content-Location header field (section 14.14) differs
from Location in that the Content-Location identifies the original
location of the entity enclosed in the request. It is therefore
possible for a response to contain header fields for both Location
and Content-Location. Also see section 13.10 for cache
requirements of some methods.
User avatar
cactus
Forum Regular
Posts: 343
Joined: Tue Jun 10, 2003 4:16 am
Location: UK

Post by cactus »

[]InTeR[] wrote:There should be no space at all....
In some older versions of PHP the interpretaion of the "Location" directive was flawed and didn't follow the RFC. Later versions are compliant.

To the OP, what does $_SERVER['REQUEST_URI'] contain, echo this out if you can.

Regards,
adneg
Forum Newbie
Posts: 13
Joined: Wed May 21, 2003 11:20 am

Post by adneg »

space or no space still have the same problem.

the requested URL /site/site.php/home/index.osp was not found on this server

$_SERVER['REQUEST_URI'] do not understand?
User avatar
cactus
Forum Regular
Posts: 343
Joined: Tue Jun 10, 2003 4:16 am
Location: UK

Post by cactus »

The format of the query string isn't too much of an issue, but how its being parsed in "site.php" could be the problem.

Can you post the code of "site.php" and any error messages you are recieving.

Regards,
User avatar
phice
Moderator
Posts: 1416
Joined: Sat Apr 20, 2002 3:14 pm
Location: Dallas, TX
Contact:

Post by phice »

In the httpd.conf, do:
AddType application/x-httpd-php .php
AddType application/x-httpd-php .osp

One for each extention.
Image Image
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

you're sure the path is correct?
User avatar
phice
Moderator
Posts: 1416
Joined: Sat Apr 20, 2002 3:14 pm
Location: Dallas, TX
Contact:

Post by phice »

volka wrote:you're sure the path is correct?
That's also a good question, because even http://fletcher.co.uk/ isn't working for me.
User avatar
cactus
Forum Regular
Posts: 343
Joined: Tue Jun 10, 2003 4:16 am
Location: UK

Post by cactus »

phice wrote:
volka wrote:you're sure the path is correct?
That's also a good question, because even http://fletcher.co.uk/ isn't working for me.
I was able to access that yesterday but now it throws a 404. Have you changed/deleted any files from this domain ?

Regards,
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

That path is so wrong.

How can anything.php/home/index/whatever.html work? ever?

Isn't that impossible? I can understand anything.php?path=/home/index/whatever.html but the first way just seems wrong.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

if anything.php is a directory it's handled as usual, no problem here.
It might be a bit confusing but even if anything.php is a script it might be working. Place a script called anything.php

Code: Select all

<?php
echo $_SERVER['REQUEST_URI'];
?>
in your document root and call and request it as http://<your-server>/anything.php/what/ever/you/like
(only tested with apache/php-module)
Post Reply