• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Reply to: PHP pages

Collapse

You are not logged in or you do not have permission to access this page. This could be due to one of several reasons:

  • You are not logged in. If you are already registered, fill in the form below to log in, or follow the "Sign Up" link to register a new account.
  • You may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
  • If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.

Previously on "PHP pages"

Collapse

  • NickFitz
    replied
    FWIW, my presentation at the first BarCampLondon was entitled The Correct Use of HTTP, which was intended as a pun on the title of Magazine's album The Correct Use of Soap - the idea being to argue against fundamentally misguided approaches such as SOAP, in favour of a RESTful approach that used HTTP as originally intended.

    Sadly, nobody else there was either old enough, or sufficiently well-informed about HTTP, to get the joke

    Leave a comment:


  • Jog On
    replied
    This is a good explanation of why I have been faffing around with PHP:

    http://www.marketingexperiments.com/...t-testing.html

    Leave a comment:


  • Jog On
    replied
    Originally posted by NickFitz View Post
    Personally I firmly advocate nowadays that the underlying technology has no business being present in a URI.

    So, rather than http://example.com/catalogue/page1.html or http://example.com/catalogue.php?page=1 I'd be setting the server up to deal with http://example.com/catalogue/1 and so forth.

    The .html extension seems harmless, whereas extensions like .php, .asp or .aspx become a nuisance when you move to a different platform and are left with a shedload of redirects that you have to maintain for ever. But even .html is inappropriate IMNSHO, because a URI is supposed to identify a resource (or the location of a resource, in the case of a URL), and by including .html you're restricting it to identifying a specific representation of that resource.

    Therefore I would argue that, although you may support URIs that include content-type information such as .html, the canonical form of the URI should be in the form that contains no information about the content-type of the resource, and certainly no information about something so completely irrelevant to the identification of a resource as the technology used (at the moment) to serve that resource.

    Note that, if you do support the version with the type-denoting-extension in addition to the canonical version, you should take the additional steps necessary to ensure that only the canonical form is indexed by search engines, or you'll risk being penalised for having duplicate content, and also risk being forced to maintain the non-canonical versions.

    RESTful Web Services by Richardson and Ruby is an excellent book on the correct use of HTTP, including a detailed discussion of URL design.
    Thankyou for that - and have a banana

    It's all working now so everyone please have a banana on me:








    It's the same HTML/PHP page being served but the one element I'm split testing, be it the headline, a paragraph, a graphic, call to action, testimonial, price etc...


    ... is swapped out - the PHP script just shows the element I choose to split test i different versions to every alternate visitor so I can measure if a change to a page has a positive or negative affect on conversions or not and if that change is statistically significant.

    It's all about the money old boy

    Leave a comment:


  • NickFitz
    replied
    Personally I firmly advocate nowadays that the underlying technology has no business being present in a URI.

    So, rather than http://example.com/catalogue/page1.html or http://example.com/catalogue.php?page=1 I'd be setting the server up to deal with http://example.com/catalogue/1 and so forth.

    The .html extension seems harmless, whereas extensions like .php, .asp or .aspx become a nuisance when you move to a different platform and are left with a shedload of redirects that you have to maintain for ever. But even .html is inappropriate IMNSHO, because a URI is supposed to identify a resource (or the location of a resource, in the case of a URL), and by including .html you're restricting it to identifying a specific representation of that resource.

    Therefore I would argue that, although you may support URIs that include content-type information such as .html, the canonical form of the URI should be in the form that contains no information about the content-type of the resource, and certainly no information about something so completely irrelevant to the identification of a resource as the technology used (at the moment) to serve that resource.

    Note that, if you do support the version with the type-denoting-extension in addition to the canonical version, you should take the additional steps necessary to ensure that only the canonical form is indexed by search engines, or you'll risk being penalised for having duplicate content, and also risk being forced to maintain the non-canonical versions.

    RESTful Web Services by Richardson and Ruby is an excellent book on the correct use of HTTP, including a detailed discussion of URL design.

    Leave a comment:


  • Jog On
    replied
    Originally posted by Ardesco View Post
    Hmm, have you double checked the file permissions? you may be showing too much to the world
    I can't set them to 777 but the script directory is 755

    Leave a comment:


  • Ardesco
    replied
    Hmm, have you double checked the file permissions? you may be showing too much to the world

    Leave a comment:


  • Jog On
    replied
    Unfortunately I can't use the .htaccess file for things like that now as my hosting company has moved the goalposts somewhat..

    Even with their php.ini file and apache handlers set up in Cpanel it doesn't work.

    I'll wait and see if the guy who wrote my split testing script can fix it as I've done everthing the hosting company said to in that thread

    Otherwise I'll redirect for the exisiting pages and just write php pages from now on.

    Leave a comment:


  • Ardesco
    replied
    You could also try putting the following in an .htaccess file (assuming that apache is serving files):

    Code:
    <FilesMatch "\.(html)$">
       SetHandler application/x-httpd-php
    </FilesMatch>
    (assuming you haven't already done this)
    Last edited by Ardesco; 11 February 2008, 16:17.

    Leave a comment:


  • Jog On
    replied
    I think I'll just redirect the html pages to the php pages while I split test them until they fix the apache handler thing or whatever it is that's stopping PHP in html pages.

    And create .php pages from now on - at least for the ones I intend to split test anyway

    Leave a comment:


  • Sockpuppet
    replied
    Or you could use Mod_Rewrite to point blah.html at blah.php

    You may have to learn to love regex

    Leave a comment:


  • Ardesco
    replied
    Originally posted by Jog On View Post
    Yeah I've done that, I did it with an option in my Cpanel there's something up with either the script or my hosting company.

    The guy who wrote the script is working on getting html pages to be treated as PHP. I've posted on another forum and had an answer that if I do rename the html files to php they will be treated by the search engines as new files and indexed as new pages so they're staying as html

    I'll just be patient and wait.....
    Could always try adding a index.php and changing the index.html to auto redirect to the index.php.

    Leave a comment:


  • Jog On
    replied
    Originally posted by FiveTimes View Post
    have you modified httpd.conf to have something like

    AddType application/x-httpd-php .php .html
    Yeah I've done that, I did it with an option in my Cpanel there's something up with either the script or my hosting company.

    The guy who wrote the script is working on getting html pages to be treated as PHP. I've posted on another forum and had an answer that if I do rename the html files to php they will be treated by the search engines as new files and indexed as new pages so they're staying as html

    I'll just be patient and wait.....

    Leave a comment:


  • FiveTimes
    replied
    have you modified httpd.conf to have something like

    AddType application/x-httpd-php .php .html

    Leave a comment:


  • Jog On
    replied
    Thanks for that - Apache is handling PHP pages OK.

    I have used test PHP pages to see if this script works and it does. The problem is with getting PHP to work in pages with a .html extension.

    I have set up handlers to tell apache to handle html as PHP but it's not working - even after going through it with my hosting company several times.

    That's why I'm just tempted to change the extensions of the html pages to .php - I'm just concerned about:

    1. Do I need to do anything else to the pages themselves apart from rename them?

    2. If those pages are on the first page of Google/Yahoo/MSN will they get dropped if I change the file extension?

    Leave a comment:


  • Sockpuppet
    replied
    Erm.

    You have to tell apache to handle the .php page as a PHP page otherwise it won't work and won't use the apache engine.

    If you don't want to change the extension you could tell apache to handle html pages as php pages and just stick the php in there.

    A standard html page sent through apache/php will just come out the same as it went in only when it find <?php ?> to process does the page change.

    Leave a comment:

Working...
X