SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot Macchiato's Avatar
    Join Date
    Nov 2009
    Posts
    149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Hide page name & extension in address bar

    How can I hide my page name and extension in the address bar?

    For example when I click on my "Home" link, it would take me to:

    www.mysite.com/index.html

    but instead I'd like it show in the address bar without the page name and extension, like this:

    www.mysite.com/

    I also like to apply this to other directories, like for example if I click on the link "Coffee", the address bar will look like this:

    www.mysite.com/products/

    instead of this:

    www.mysite.com/products/coffee.html


    How can I do this?

  2. #2
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,604
    Mentioned
    19 Post(s)
    Tagged
    2 Thread(s)
    Mac,

    For the lack of file specified, you should just use the absolute URL for your link. As for converting products/ to products/coffee.html, that's ONLY possible if coffee.html is the DirectoryIndex (default file) for products/. Otherwise, Apache has no way of guessing what file in the directory you want served.

    Have a read of the mod_rewrite tutorial linked in my signature for more information. THEN, if that's what you want, come back with a "specification" and I'll help you through it.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  3. #3
    SitePoint Zealot Macchiato's Avatar
    Join Date
    Nov 2009
    Posts
    149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks DK,

    I will read your mod_rewrite tutorial


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
  •