www.webdeveloper.com
Results 1 to 2 of 2

Thread: Rewrite Ugly url to User-Friendly url

  1. #1
    Join Date
    May 2010
    Posts
    1

    Rewrite Ugly url to User-Friendly url

    I have an html based website that needs urls converted from
    website.com/index.html?category=12
    to
    website.com/category-name/12.html

    the website has no mysql database. the urls are written through javascript.

    download from below the js + html files
    Code:
    http://www.mediafire.com/?knjyz3rnr4m
    urls writing rules can be found on common.js and set_form_menu.js.gz files

    I'd appreciate some input on this ..

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Code:
    var url = 'website.com/index.html?category=12';
    alert(url.replace(/(.+)\/.+\?(\w+)=(\d+)/, '$1/$2/$3.html'))

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