Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other /whatever/ instead of /whatever.php ?

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #29677
    flex4life
    Member

    I’m just getting back into web design after a few years and i noticed that page extensions are non existent now.

    For example:
    https://css-tricks.com/downloads/ instead of something like https://css-tricks.com/downloads.php

    I’m not sure how this works, what is going on here? is there some vids or articles I can check out?

    #80127
    TheDoc
    Member

    Since a lot of sites are generated dynamically now, it’s a lot easier to have the system set up folders automatically and place an index.php or index.html inside that folder.

    You can also remove extensions via .htaccess:

    Code:
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}.html -f
    RewriteRule ^(.*)$ $1.html
    # Replace html with your file extension, eg: php, htm, asp

    Why do people do it? It looks a hell of a lot cleaner to me. Which would you rather see in the url:

    https://css-tricks.com/downloads/index.php
    or
    https://css-tricks.com/downloads/

    It looks a lot cleaner without the index.php beside it, and it means it’s one less thing for users to remember.

    #80200
    flex4life
    Member

    Thank you I will look into it!

    Very helpful

    #80361

    One thing to note is that I’ve found certain hosting providers give certain limits to what you can do with htaccess. On my godaddy hosted site, nothing I did to the htaccess stuck, but on my MT hosted account it works just fine.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Other’ is closed to new topics and replies.