www.webdeveloper.com
Results 1 to 4 of 4

Thread: [RESOLVED] Beautiful URLs

  1. #1
    Join Date
    Mar 2008
    Location
    Gulf Breeze, Florida
    Posts
    171

    resolved [RESOLVED] Beautiful URLs

    I'm making my own blogging system and I want to have a way where the viewer can see one individual blog at a time but instead of using a link like this...
    example.com/blog/index.php?id=1234
    I want it to look like this, using the post title
    example.com/blog/title
    How do I do that?

  2. #2
    Join Date
    Aug 2005
    Location
    The Garden State
    Posts
    5,634
    you need a url rewriter, and a way of translating accordingly. You can have title as the ending item, but you need to ensure that title is unique. probably by limiting by user.

    edit: it's specific based on the server it runs on. if you use apache httpd, you can look at this: http://httpd.apache.org/docs/2.0/misc/rewriteguide.html
    Acceptable Use | SQL Forum FAQ | celery is tasteless | twitter

    celery is tasteless - currently needing some UI time

  3. #3
    Join Date
    Mar 2008
    Location
    Gulf Breeze, Florida
    Posts
    171
    Alrighty then! Thankyou!

  4. #4
    Join Date
    Apr 2007
    Posts
    1,664
    There is a way to do this if your server allows it.

    a url of
    example.com/blog/title

    will first look for
    example.com/blog/title/index.html

    then
    example.com/blog/title/index.php

    and whatever else it's set up to look for and will serve and index if it finds one.

    Of course it's a bit clunky as you need a directory for each clean URL. Each directory needs an index page but that index page can use a header location to redirect to anywhere on the server.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles