Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Requirement for .php in address line?

Options
  • 19-04-2013 4:10pm
    #1
    Registered Users Posts: 12,746 ✭✭✭✭


    Was trying to publicise a specific page on a website. Noticed I had to put in the full address, say http://www.mysite.com/mypage.php .

    Php bit looks a bit awkward, but /mypage wouldn't work. Fair enough, it's what I assumed.

    But then I noticed that when I went for something like http://www.mysite.com/wp-admin it'd work without adding the php.

    Using Chrome.

    Just wondering if this is down to Chrome filling in the gaps, or is there a way for the developer to influence this in some way?


Comments

  • Registered Users Posts: 282 ✭✭Kerry_2008


    i you change your mypage.php to index.php it will display it without the page name. The browser will automatically look for the index.php or index.html in a directory.


  • Registered Users Posts: 12,746 ✭✭✭✭FewFew


    Kerry_2008 wrote: »
    i you change your mypage.php to index.php it will display it without the page name. The browser will automatically look for the index.php or index.html in a directory.

    Yeah, but there's already an index.php in existence I'm afraid.

    Plus wp-admin isn't the index.php of the wordpress folder, which is what has me wondering.

    It's really the wp-admin vs mypage.php comparison that has me wondering. Neither are the index, yet one seems to work without the extension.


  • Registered Users Posts: 291 ✭✭Seridisand


    If your site is running on Apache you can use the mod-rewrite to do something like
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}\.php -f
    RewriteRule ^mypage$ mypage.php [L]
    


  • Registered Users Posts: 12,746 ✭✭✭✭FewFew


    Seridisand wrote: »
    If your site is running on Apache you can use the mod-rewrite to do something like
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}\.php -f
    RewriteRule ^mypage$ mypage.php [L]
    

    Ah great! Suspected it was something like that alright :)

    Thanks :)


  • Registered Users Posts: 369 ✭✭thelikelylad


    Fewcifur wrote: »
    Yeah, but there's already an index.php in existence I'm afraid.

    Plus wp-admin isn't the index.php of the wordpress folder, which is what has me wondering.

    It's really the wp-admin vs mypage.php comparison that has me wondering. Neither are the index, yet one seems to work without the extension.

    wp-admin is a directory within the main wordpress directory.

    When you browse to http://mysite.com/wp-admin I assume it's actually loading http://mysite.com/wp-admin/index.php


  • Advertisement
  • Registered Users Posts: 12,746 ✭✭✭✭FewFew


    wp-admin is a directory within the main wordpress directory.

    When you browse to http://mysite.com/wp-admin I assume it's actually loading http://mysite.com/wp-admin/index.php

    You're actually spot on. Now I'll have to overload on the :o smilie. Should have labelled the question as noob. :o:o:o


  • Registered Users Posts: 291 ✭✭Seridisand


    If it's a wp site, you can use a plugin like http://wordpress.org/support/plugin/pretty-link


Advertisement