Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Mar 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Getting Rid of File Extensions

    Hello.
    I've noticed on web pages, such as Google Images, that their URL has no file extensions so instead of the url being 'www.google.com\images.html'
    it is 'www.google.com\images' , there is no extension. I would like to no how I can have this sort of URL so I can have 'home' instead of 'home.html' etc.
    Thank You!

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,932
    Thanks
    6
    Thanked 1,041 Times in 1,014 Posts
    The complicated way would be to create an own directory for each page and put the page as index.html in there, i. e. for an about page create a sub directory called “about” and the about page would be index.html inside that directory.

    The easy way is called “pretty URL” and can be done by modifying the server config, usually with an .htaccess file (if permitted/supported). You know what you have to search for now.

  • #3
    Regular Coder patryk's Avatar
    Join Date
    Oct 2012
    Location
    /dev/couch
    Posts
    398
    Thanks
    2
    Thanked 64 Times in 64 Posts
    funny thing. my apache2 (nothing special - standard build from ubuntu repo) actually came with this out-of-box.
    works for *.html, *.htm and *.php

    ---edit---

    i figured out what's going on.
    it's caused by mod_negotiation.
    basicaly if it's enabled it will try to guess mime type of document if you won't provide suffix and if file exists it will be server instead of 404 document.
    if this module is installed, you can enable it in .htaccess
    Code:
    Options +MultiViews
    Last edited by patryk; 03-28-2013 at 04:28 AM.

  • #4
    New to the CF scene
    Join Date
    Mar 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Reply

    Thanks guys, really helpful!


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •