Results 1 to 23 of 23
  1. #1
    Dream Cruise megatonloh's Avatar
    Join Date
    June 5th, 2005
    Location
    Look East
    Posts
    418
    Can html index and php index run parallel
    Can we use both the index for html and php for the same domain with different content structure.

    http://www.mysite.com/ for html
    http://www.mysite.com/index.php

    I had tested for one of my domain and both are working. Is there any rules against these and are they acceptable by the SE


    Thanks
    Richard

  2. #2
    Member reneton's Avatar
    Join Date
    January 18th, 2005
    Location
    Estonia
    Posts
    74
    What's the benefit of running them in parallel?

    Renet

  3. #3
    Resident Genius and Staunch Capitalist Leader's Avatar
    Join Date
    January 18th, 2005
    Location
    Florida
    Posts
    12,817
    If I have an index.html page, whenever the domain is accessed via "www.example.com" the server sends traffic to that page whether or not I have index pages with other extensions. Personally I don't want this behavior (especially since it usually happens when I forget to delete the "default" index page that's generated upon site activation). So, I make sure I only have an index with the extension I actually want the server to use, and delete all others.

    But, they CAN all run--just not when using "www.sitename.com" (without naming a specific page). If you put, "www.sitename.com/index.php" or whatever, making sure to specify just which index page you want, it'll come up that way.

    However, if someone simply remembers your site and wants to return to it, they'll likely just put in the main URL--in that case, they'll get the .html one, assuming typical server configuration.

    are they acceptable by the SE
    I would expect that multiples would be treated as on-site duplicate content by SEs, assuming the spiders find them.

  4. #4
    Comfortably Numb John Powell's Avatar
    Join Date
    October 17th, 2005
    Location
    Bayou Country, LA
    Posts
    3,432
    Can we use both the index for html and php for the same domain with different content structure.
    Leader pretty much nailed it, but could you say a couple of lines explaining what you are trying to do here?

  5. #5
    Full Member
    Join Date
    October 22nd, 2006
    Posts
    200
    The order in which your index pages are accessed is set in the apache configuration file using the DirectoryIndex directive.

    This is set by you server admin and is in the format:
    DirectoryIndex index.html index.php
    The server look for these files in order and if they are not found the browser will display a directory listing.

    You can use this directive in your .htaccess file. so if you want the default file to be the php one put
    DirectoryIndex index.php index.html
    in your .htaccess file.

  6. #6
    Dream Cruise megatonloh's Avatar
    Join Date
    June 5th, 2005
    Location
    Look East
    Posts
    418
    Leader pretty much nailed it, but could you say a couple of lines explaining what you are trying to do here?
    bumpaw, I guess you are directing this question to me.

    What I am thinking is, I treat these two as different pages with different content in it.

    Let say that I run a shopping mall site. I use the html page solely as a content page with links to product pages and the php page will be one of the product page using the merchant datafeed.

    Technically I am not familiar whether it will cross each other path or get entangled when people open the two pages at the same time.

    In other words can a domain works with html and php pages together.
    www.mysite.com/
    www.mysite.com/index.php
    www.mysite.com/clothing.html
    www.mysite.com/shoes.php

    Thanks
    Richard

  7. #7
    Comfortably Numb John Powell's Avatar
    Join Date
    October 17th, 2005
    Location
    Bayou Country, LA
    Posts
    3,432
    You can put this in your .htaccess file (assuming Apache):
    Code:
    AddHandler application/x-httpd-php .php .html
    Now you can name files somthing.html and it will read them as if they were something.php. You have to put <?php ?> around the PHP part.
    In other words can a domain works with html and php pages together.
    Yes

  8. #8
    Full Member
    Join Date
    December 20th, 2005
    Posts
    413
    Quote Originally Posted by megatonloh
    Let say that I run a shopping mall site. I use the html page solely as a content page with links to product pages and the php page will be one of the product page using the merchant datafeed.
    ...
    In other words can a domain works with html and php pages together.
    www.mysite.com/
    www.mysite.com/index.php
    www.mysite.com/clothing.html
    www.mysite.com/shoes.php
    Perhaps what you're currently thinking of as index.php might just as well be products.php. Would that solve the problem?
    [URL=http://themoneyforums.com]The Money Forums[/URL]

  9. #9
    Affiliate Manager MINDsprinter's Avatar
    Join Date
    August 18th, 2006
    Location
    Washington, DC
    Posts
    1,436
    You can definitely use php and html pages on the same domain, if that's what you are asking. If you have www.mydomain.com/index.html and www.mydomain.com/shopping.php, that is no problem.
    Jason Rosenbaum
    Affiliate Manager
    MINDsprinting

  10. #10
    Dream Cruise megatonloh's Avatar
    Join Date
    June 5th, 2005
    Location
    Look East
    Posts
    418
    Thanks everyone for your input.

    You can definitely use php and html pages on the same domain, if that's what you are asking. If you have www.mydomain.com/index.html and www.mydomain.com/shopping.php, that is no problem.
    MINDsprinter, your quote above.
    Can I safely says that
    www.mysite.com which is suppose to be the index page can allow another page such as this
    www.mysite.com/index.php
    but if the page is
    www.mysite.com/index.html can we have another page such as this
    www.mysite.com/index.php or it is best not to name it that way and name it
    www.mysite.com/anyname.php like what DoctorMike stated.
    Perhaps what you're currently thinking of as index.php might just as well be products.php. Would that solve the problem?
    DoctorMike, what I am saying is, will there be any problem if I use both indexes, one for html and the other for php.


    Thanks
    Richard

  11. #11
    Affiliate Manager MINDsprinter's Avatar
    Join Date
    August 18th, 2006
    Location
    Washington, DC
    Posts
    1,436
    As shown by bumpaw, you can have an index.html and an index.php page, and you can control which one gets displayed by default when someone types in www.mysite.com with .htaccess.

    However, why would you want to have two index pages? If they have different content it would save yourself a lot of confusion to decide one will be your main, default page for your domain and one will be, say, your product page (so named products.php). Just easier and much less confusing.
    Jason Rosenbaum
    Affiliate Manager
    MINDsprinting

  12. #12
    Dream Cruise megatonloh's Avatar
    Join Date
    June 5th, 2005
    Location
    Look East
    Posts
    418
    MINDSprinter, thanks for the confirmation.

    It started like this. I am new to php and recently I start to change over to php and when I name my first php page, my mind just follow the html way and name it index.php
    I had placed a few links around for this index.php page and already uploaded for about two weeks. Then only yesterday I realise that there is two index pages and that is why I post this question.


    Thanks
    Richard

  13. #13
    Full Member
    Join Date
    December 20th, 2005
    Posts
    413
    Then it does sound like you'll make things easier for yourself if you simply rename one of your index files to something else. Like Jason said, choose which one you want visitors to land on - from what you've written, I think this is your index.html - and rename your index.php to products.php or whatever. If you like, add a 301 redirect in your .htaccess from index.php to products.php.
    [URL=http://themoneyforums.com]The Money Forums[/URL]

  14. #14
    Dream Cruise megatonloh's Avatar
    Join Date
    June 5th, 2005
    Location
    Look East
    Posts
    418
    Thank you DoctorMike, I just will have to change the index.php to another name. That would be easier.

    Try not to touch the .htaccess as yet, still learning and do not want to mess thing further for now.


    Thanks everyone, maybe another thread on other technical questions.


    Thanks
    Richard

  15. #15
    ABW Ambassador Snib's Avatar
    Join Date
    January 18th, 2005
    Location
    Virginia
    Posts
    5,303
    Quote Originally Posted by megatonloh
    I had placed a few links around for this index.php page and already uploaded for about two weeks. Then only yesterday I realise that there is two index pages and that is why I post this question.
    That's a quick fix. There's a very handy perl command that will search and replace among all of your files:

    Code:
    perl -pe "s/index\.php/products\.php/g" *
    This will replace all instances of "index.php" with "products.php" in all of the documents you specify. So you can do this on *.php or *.html or anything you'd like (example uses *). You just need to have shell/ssh access to your site. Or if you have a Mac you can do this locally and re-upload.

    - Scott
    Hatred stirs up strife, But love covers all transgressions.

  16. #16
    Full Member
    Join Date
    December 20th, 2005
    Posts
    413
    Quote Originally Posted by Snib
    Or if you have a Mac you can do this locally and re-upload.
    Wouldn't ActivePerl on a PC also work?
    [URL=http://themoneyforums.com]The Money Forums[/URL]

  17. #17
    ABW Ambassador Snib's Avatar
    Join Date
    January 18th, 2005
    Location
    Virginia
    Posts
    5,303
    Quote Originally Posted by DoctorMike


    Wouldn't ActivePerl on a PC also work?
    If you install perl on your PC it should work, but it's not available by default.

    - Scott
    Hatred stirs up strife, But love covers all transgressions.

  18. #18
    Dream Cruise megatonloh's Avatar
    Join Date
    June 5th, 2005
    Location
    Look East
    Posts
    418
    Hi Scott,

    That's a quick fix. There's a very handy perl command that will search and replace among all of your files:

    Code:
    perl -pe "s/index\.php/products\.php/g" *
    Where do we put this code?


    Thanks
    Richard

  19. #19
    ABW Ambassador Snib's Avatar
    Join Date
    January 18th, 2005
    Location
    Virginia
    Posts
    5,303
    Quote Originally Posted by megatonloh
    Where do we put this code?
    You run it from your /public_html command line. You need to have ssh/shell access to your server though. Some web hosts don't have this option, so it's always best to choose a web host that gives you ssh access.

    If you don't know what ssh is, it's an alternate way to connect to your server (rather than FTP). It's sort of like Dos except for Linux/Unix.

    - Scott
    Hatred stirs up strife, But love covers all transgressions.

  20. #20
    Dream Cruise megatonloh's Avatar
    Join Date
    June 5th, 2005
    Location
    Look East
    Posts
    418
    Thanks Scott

  21. #21
    Comfortably Numb John Powell's Avatar
    Join Date
    October 17th, 2005
    Location
    Bayou Country, LA
    Posts
    3,432
    I wouldn't recommend that us average Joe's do that. You would be changing file names and links on the server without changing them in your local PC files. It seems it would be to easy to get confused and later up load the files without the changes.

    Why not just do find/replace on PC files and then upload? Then you have copies of your changes. Am I missing something here?

  22. #22
    Full Member
    Join Date
    December 20th, 2005
    Posts
    413
    It might be overkill. Megatonloh wrote that he had put up a few links to the index.php site. Probably it's easy enough to just change them by hand.
    [URL=http://themoneyforums.com]The Money Forums[/URL]

  23. #23
    ABW Ambassador Snib's Avatar
    Join Date
    January 18th, 2005
    Location
    Virginia
    Posts
    5,303
    Quote Originally Posted by bumpaw
    I wouldn't recommend that us average Joe's do that. You would be changing file names and links on the server without changing them in your local PC files. It seems it would be to easy to get confused and later up load the files without the changes.

    Why not just do find/replace on PC files and then upload? Then you have copies of your changes. Am I missing something here?
    You make an excellent point. It's always best to make changes to your local copies first then propagate those changes to the live server.

    - Scott
    Hatred stirs up strife, But love covers all transgressions.

  24. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Dont want index.html to be store
    By makenoiz in forum Cusimano.com Scripts
    Replies: 2
    Last Post: March 24th, 2006, 11:08 AM
  2. No index.html file Allposters
    By makenoiz in forum Cusimano.com Scripts
    Replies: 1
    Last Post: January 12th, 2006, 11:08 AM
  3. html 101 - index.htm or index.html?
    By Cheesehead in forum Programming / Datafeeds / Tools
    Replies: 4
    Last Post: August 31st, 2005, 04:20 PM
  4. index.php and index.html
    By Roland in forum Search Engine Optimization
    Replies: 9
    Last Post: November 21st, 2004, 10:59 PM
  5. Index.html - please advise
    By kky2k in forum Cusimano.com Scripts
    Replies: 4
    Last Post: November 12th, 2003, 02:36 PM

Posting Permissions

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