Results 1 to 5 of 5

Thread: AddHandler for php

  1. #1
    Junior Member
    Join Date
    Jan 2006
    Posts
    18

    Default AddHandler for php

    I currently have the line in my .htaccess files:
    AddHandler application/x-httpd-php5 .php .php3 .html .htm

    In a post that Andrew did for the php5 upgrade, he said that we shouldn't have this line, so that in the future, if the servers are upgraded to, say, php6, this wouldn't work. However, is there any type of AddHandler that would say, use the default version of php for these file extensions (rather than this one, which says, use php5 for these file extensions)?
    The problem is that I need my .html (and other non-php extension) files processed as php files.

    Thanks,
    -Lori-

  2. #2
    Administrator
    Join Date
    Mar 2004
    Location
    Tulsa, OK
    Posts
    3,484

    Default

    You'll need to use that line and make sure that it stays updated in order to force alternative extensions to be executed by PHP. Generally it is better just to rename the files.

  3. #3
    Junior Member
    Join Date
    Jan 2006
    Posts
    18

    Default

    I'm building a new website, and most of the files will be .php. However, I do have an index.html file from my current site, and I thought I should keep it as index.html for the new site, instead of index.php, since I have lots of links to it already, and it ranks pretty well in google for certain keywords.

    If I rename it to index.php, and have a redirect in .htaccess, from index.html to index.php, with a 302 (permanently moved) code, will that work ok in the search engines, or will I lose my ranking that I had for index.html?

    Also, would I need to add anything to the .htaccess, like a DirectoryIndex directive, or would it use index.php if there is no index.html?

    Thanks!

  4. #4
    Administrator
    Join Date
    Mar 2004
    Location
    Tulsa, OK
    Posts
    3,484

    Default

    I cannot offer you SEO advice. You would be best off consulting someone that specializes in this.

    If no index.html is present, the index.php will load.

  5. #5
    Senior Member
    Join Date
    Sep 2005
    Location
    Russia, Nizhny Novgorod
    Posts
    315

    Default

    You are not obliged to use external redirects in such a case, e.g. you can make use of mod_rewrite capabilities:

    RewriteRule ^(/?)index.html$ index.php [L]

    P.S. I am not sure whether / is necessary or not.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •