PHP codes in HTML files?

Discussion in 'PHP' started by Gravereaper, Dec 3, 2006.

  1. #1
    Is it possible to execute PHP codes in HTML file, because i'am making a PHP powered site right now and search engine won't index it if all the pages are .php
     
    Gravereaper, Dec 3, 2006 IP
  2. ResaleBroker

    ResaleBroker Active Member

    Messages:
    1,665
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    90
    #2
    That is not my understanding.
     
    ResaleBroker, Dec 3, 2006 IP
  3. aaron_nimocks

    aaron_nimocks Im kind of a big deal Staff

    Messages:
    5,563
    Likes Received:
    627
    Best Answers:
    0
    Trophy Points:
    420
    #3
    Why wouldnt the search engine index it if its all php? There are plently of sites that are all .php and get indexed.
     
    aaron_nimocks, Dec 3, 2006 IP
  4. Gravereaper

    Gravereaper Banned

    Messages:
    450
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I remember reading this part in some SEO site, anyways there are a lot of sites which are obviously powered by PHP but still have .html pages displaying all the outputs.. how do they do that?

    Anyways, its not important to know if php sites gets indexed but still i'am curious..
     
    Gravereaper, Dec 3, 2006 IP
  5. just-4-teens

    just-4-teens Peon

    Messages:
    3,967
    Likes Received:
    168
    Best Answers:
    0
    Trophy Points:
    0
    #5
    all my sites are .php and all are indexed
     
    just-4-teens, Dec 3, 2006 IP
  6. Bagi Zoltán

    Bagi Zoltán Well-Known Member

    Messages:
    364
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    110
    #6
    I'm sure You are able to build a SE friendly php site. Well i think the best You can do is to read the google's guidlines. Eg. You can use .htaccess rendering static urls from dinamics.
     
    Bagi Zoltán, Dec 3, 2006 IP
  7. JEET

    JEET Notable Member

    Messages:
    3,832
    Likes Received:
    502
    Best Answers:
    19
    Trophy Points:
    265
    #7
    There are actually 2 ways of doing this.

    1. Have a PHP backend, and create a static html site with it. Very complicated. Plus make sure to protect your PHP backend, otherwise anyone can update the pages of your site.
    2. Use .htaccess.

    By the way, take a look at the URL in the address bar. Do you think it won't get indexed? ;)
    Bye :)
     
    JEET, Dec 3, 2006 IP
  8. ResaleBroker

    ResaleBroker Active Member

    Messages:
    1,665
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    90
    #8
    If you're running apache you can add this line of code to your .htaccess file:

    AddType application/x-httpd-php .php .html
     
    ResaleBroker, Dec 3, 2006 IP
  9. Silver89

    Silver89 Notable Member

    Messages:
    2,243
    Likes Received:
    72
    Best Answers:
    0
    Trophy Points:
    205
    #9
    or just use mod rewrite
     
    Silver89, Dec 3, 2006 IP
  10. Gravereaper

    Gravereaper Banned

    Messages:
    450
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Maybe i'll just stick with my PHP files as they won't cause any SEO problems, besides modifying my .htaccess files will be confusing on my actual web server.
     
    Gravereaper, Dec 3, 2006 IP
  11. Luke

    Luke Peon

    Messages:
    111
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #11
    PHP's output is technically HTML, PHP is just the way its parsed on the server then it is handed to the USER in HTML assuming of course all your coding is based in HTML.

    Must of the bigger websites use ASP or PHP so they most definately dont have a problem with Search Engines.
     
    Luke, Dec 4, 2006 IP
  12. xtreme fever

    xtreme fever Active Member

    Messages:
    472
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    95
    #12
    unless i did something wrong, the file either wants to be opened or downloaded.
     
    xtreme fever, Dec 8, 2006 IP
  13. parusa619

    parusa619 Banned

    Messages:
    556
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Can I see your site's URL? There are some php sites that are indexed by SEs. Are you familiar with mod_rewrite?
     
    parusa619, Dec 9, 2006 IP