SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Member frankie54's Avatar
    Join Date
    Feb 2001
    Location
    NYC
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    about the age-old quest for abstraction layers and portability

    In building my little web site, I was enviously admiring how some designers are able to hide .php extensions, make some of their dynamic pages eaily spiderable and use abstration layers to be able to move their web sites easily between ISP's.

    The little prodding I did so far revealed that a lot of this seems to involve phpLib or similar.

    My newbie question is : Is there a way to easily mask your 'index.php' so that the person who logs on to your site sees either index.html or a customized URL rather than 'http://yoursite.com/index.php', and further make the 'http://www.yoursite.com/script.php?action=data'into something that is more search-engine friendly, but doesn't require to read the complete space shuttle operating amnual?

    I just did a redirect from my index.html to index.php, and it works, but I tought there perhaps would be a more elegant way.
    stay groovy !

  2. #2
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    To make Apache parse .htm files as PHP files add the following to a .htaccess file:

    AddType application/x-httpd-php .htm

    As for the SE friendly URLs just search there are hundreds of posts on this!

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  3. #3
    SitePoint Member frankie54's Avatar
    Join Date
    Feb 2001
    Location
    NYC
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    is that in the httpd.conf file??

    Are you saying that this directive to parse .html as .php should be in the .conf file for Apache, at the part where you tell it how to deal with .htaccess??

    Or is this in the .htaccess file itself?

    If I understand, you are saying I should rename my index.php file to index.html and it the <?php code ?> will be parsed correctly because the web server will know?

    Also, when you do this, can it be directory-specific, or for the whole host? (I don't have virtual hosts yet)

    Curious...
    Last edited by frankie54; Oct 25, 2001 at 16:08.
    stay groovy !

  4. #4
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: is that in the httpd.conf file??

    Originally posted by frankie54
    Are you saying that this directive to parse .html as .php should be in the .conf file for Apache, at the part where you tell it how to deal with .htaccess??

    Or is this in the .htaccess file itself?
    Originally posted by seanf
    To make Apache parse .htm files as PHP files add the following to a .htaccess file:

    AddType application/x-httpd-php .htm
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*

  5. #5
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: is that in the httpd.conf file??

    Originally posted by frankie54
    Also, when you do this, can it be directory-specific, or for the whole host? (I don't have virtual hosts yet)
    If you put it in the root of your account all .htm files will be parsed, if you put it in a sub-directory only the .htm files in that directory and ones under that will be parsed

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature


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
  •