SitePoint Sponsor

User Tag List

Results 1 to 10 of 10

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Sep 2013
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to change file extension?

    Hello!

    I am a novice programmer. The point is that I created a whole website with a php extension, because I had read a few sources that if you want to create a website with php, you need all your pages to do with a php extension, but I have a page as Registration, enter personal Cabinet, shopping cart, these pages I have also a php extension, although if I understand it correctly, pages: Registration, enter personal Cabinet - a must-have extensions to html. Even if I understand correctly, then change the file extension, for example with php to html in normal Notepad Windows7, as people say, a file with the changed file extension may not work: what will turn on the system whether DOS, or some other (don't remember) which will bring failure. But the sort of know that if you change the extension of the file in Notepad++, then everything will be fine: I think in Notepad++, there's a feature that allows you to change the file extension (without causing harm to file with the changed file extension). I still create all your pages using a standard Notepad windows7.
    Do I need to change the extension of the pages of the site Registration, enter personal Cabinet, a Basket of the buyer on the html? Excuse me please if I do not understand something. I am only learning.

    Tell me, please, whether you want to switch to Notepad++? It really so good?

    Thanks in advance.

  2. #2
    SitePoint Member
    Join Date
    Dec 2013
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If I understand correctly, you want to show some .php files as .html files?

    If so, take a look at:

    http://www.sitepoint.com/apache-mod_rewrite-examples/

    Enter something like:

    Code:
    RewriteEngine on 
    
    RewriteRule ^/?test.html$ test.php [L]
    into your .htaccess file.

    If you just change the file extension from PHP to HTML then the server will not know it's a PHP file and won't process it correctly.

  3. #3
    SitePoint Wizard lorenw's Avatar
    Join Date
    Feb 2005
    Location
    was rainy Oregon now sunny Florida
    Posts
    1,101
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I would just leave the php extension, no harm in doing so.
    Possibly even better if you leave it as php if in a few years you may want to add some php to those files.
    All of my files are .php whether they contain php or not.
    What I lack in acuracy I make up for in misteaks

  4. #4
    SitePoint Member
    Join Date
    Sep 2013
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you for your reply!

    If I understand correctly, that the expansion of pages Registration, enter personal Cabinet and a Basket of buyers do not need to change the HTML? And tell me , please, what is your opinion of Notepad++.

    Thanks in advance.

  5. #5
    SitePoint Wizard lorenw's Avatar
    Join Date
    Feb 2005
    Location
    was rainy Oregon now sunny Florida
    Posts
    1,101
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I use Notepad++ and it is great, lots of useful plugins also.
    What I lack in acuracy I make up for in misteaks

  6. #6
    SitePoint Addict bronze trophy
    Join Date
    Apr 2013
    Location
    Ithaca
    Posts
    351
    Mentioned
    6 Post(s)
    Tagged
    1 Thread(s)
    One advantage of using Notepad++ is that its fast to launch and easy to use, I normally use it when I only wish to modify one or a few lines of code. If I need to write one or several class files Id actually use Netbeans instead.

  7. #7
    SitePoint Member
    Join Date
    Sep 2013
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you all for your explanations about Notepad++!

    But I have a huge request, please explain to me: " you have to change the extension of the files in the web pages: Registration, entering my account and shopping cart with php to html, because I will these names to these pages : Registration, enter personal Cabinet and a Basket of the buyer to write the php file, which will handle.

    Thanks in advance.

  8. #8
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,189
    Mentioned
    191 Post(s)
    Tagged
    2 Thread(s)
    If you have Apache and access to the httpd.conf file you can have the PHP engine process any file extension type.
    Code:
    AddType application/x-httpd-php .php .phar .htm .html

  9. #9
    SitePoint Addict bronze trophy
    Join Date
    Apr 2013
    Location
    Ithaca
    Posts
    351
    Mentioned
    6 Post(s)
    Tagged
    1 Thread(s)
    If you have windows operating system, I believe its quite easy to change file extension. Simple open it in notepad++, try the menu option 'save as' and set the file type to All, then just save your file as file.php or file.html for whatever format you will be using. I always play this trick when I need to change the extension of my template files from .html to .tpl.

  10. #10
    SitePoint Member
    Join Date
    Sep 2013
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you all for your help!


Bookmarks

Posting Permissions

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