Is there a program that will change all .php to .html?

Discussion in 'Programming' started by smallbusinessboost, Mar 18, 2006.

  1. #1
    Is there a program that will change all .php to .html?
     
    smallbusinessboost, Mar 18, 2006 IP
    Colleen likes this.
  2. amitpatel_3001

    amitpatel_3001 Results Follow Patience

    Messages:
    14,074
    Likes Received:
    1,178
    Best Answers:
    0
    Trophy Points:
    430
  3. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You can use htaccess to make your .html pages parse and execute as if they were php pages if thats what you mean.
     
    mad4, Mar 20, 2006 IP
  4. meikeric

    meikeric Peon

    Messages:
    58
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I think mad4 is onto the right path if thats what smallbusinessboost is intending.

    In your .htaccess something like this would rewrite all .html requests on the fly.

    
    RewriteEngine On
    RewriteRule ^(.*)\.html$ /$1.php
    
    Code (markup):
    I think, I know their's better regexps because (.*) is pretty ambiguous.
    Maybe
    
    RewriteEngine On
    RewriteRule ^([^.]+)\.html$ /$1.php
    
    Code (markup):
    But my Regular Expressions are escaping me. I don't know if those will work.
    Mike
     
    meikeric, Mar 24, 2006 IP
  5. sacx13

    sacx13 Active Member

    Messages:
    438
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    58
    #5
    why you dont use apache

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

    In this way you can write php code in html files !

    Best Regards
    Adrian
     
    sacx13, Mar 26, 2006 IP
  6. cls

    cls Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I use mambo cms :) and my site is search engine friendly
    My .htaccess look like this

    RewriteEngine On
    
    #  Uncomment following line if your webserver's URL 
    #  is not directly related to physical file paths.
    #  Update YourMamboDirectory (just / for root)
    
    RewriteBase /
    
    #
    #  Rules
    #
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*) index.php 
    Code (markup):
     
    cls, Mar 30, 2006 IP