SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2007
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation why doesn't appear?

    anyone can please tell me why some URLs does not show the file and its .php extension?
    tanx...

  2. #2
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    This is because most servers are set up to deliver "index.html" or "index.php" if the URL points to a directory. For example, on this forum, if you put http://www.sitepoint.com/forums/ into the URL, you will get http://www.sitepoint.com/forums/index.php

    The other possibility is that they are using some rewriting method, most likely mod_rewrite on Apache. This is quite a popular method for making "clean" URLs. Wordpress is an example of something that uses it a lot.

  3. #3
    SitePoint Evangelist hexburner's Avatar
    Join Date
    Jan 2007
    Location
    Belgium
    Posts
    591
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What do you mean exactly?
    If I understand your question right, you're asking why, for example, http://www.domain.com/page.html or http://www.domain.com/file/ are linking to a PHP file or a file parsed by PHP while the URL doesn't tell you whether it's a file with extension .php or not?
    If I'm wrong, rephrase your question please.

    I'll try to answer the interpreted question:
    You can add a Apache handler to a specific filetype -e.g. .html- to parse as PHP. Or you can rewrite a URL using htaccess and the mod_rewrite engine, so http://www.domain.com/page.php would become http://www.domain.com/page.html or http://www.domain.com/page/
    FOR SALE: 1 set of morals, never used, will sell cheap

  4. #4
    SitePoint Enthusiast
    Join Date
    Apr 2007
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well let me rephrase it, basically i would like to have my URL appear without showing the file and its extension. for example to have http://www.domain.com/folder/ instead of http://www.domain.com/folder/page.php
    please explain what should i do?
    tanx

  5. #5
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Did you not read my first post? Just change page.php to index.php and it will work unless your server is set up in an unusual way.

    If you need this to work for several different pages, then you will need to look into mod_rewrite

  6. #6
    SitePoint Enthusiast
    Join Date
    Apr 2007
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    many thanks Raffles i read and got it. take it easy.


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
  •