Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Requirement for .php in address line?

  • 19-04-2013 03:10PM
    #1
    Registered Users, Registered Users 2 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, Registered Users 2 Posts: 304 ✭✭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, Registered Users 2 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, Registered Users 2 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, Registered Users 2 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, Registered Users 2 Posts: 237 ✭✭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, Registered Users 2 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, Registered Users 2 Posts: 291 ✭✭Seridisand


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


Advertisement