1

I would like to build an online Malayalam to English and English to Malayalam dictionary.

There are two online dictionaries available, however it is not perfect so I have plan to build a good dictionary.

When I check some of the website both of them are used get method at the same time URL details are totally different method. Let me show how it working:

enter image description here

enter image description here

At the same time my website showing like this:

enter image description here

Is there any option to my URL like other two websites? I think both websites are using PHP with jQuery.

halfer
  • 19,824
  • 17
  • 99
  • 186
Mo.
  • 26,306
  • 36
  • 159
  • 225
  • 1
    You can use apache's mod_write to mangle a url however you want. I'd suggest first building your dictionary before worrying about the exact looks of the urls. – Marc B Feb 06 '12 at 17:14
  • @Marc B I have a confusion about that , Do I need make any change in php code ? – Mo. Feb 06 '12 at 17:24
  • 1
    If you mangle your urls, you'd have to make sure php knows what to look for. It's not transparent. – Marc B Feb 06 '12 at 17:26
  • It should be transparent if you use GET variables in your php. If you manually parse the REQUEST_URI you'll have to code differently. – Gerben Feb 06 '12 at 17:52
  • possible duplicate of [Pretty URLs for search pages](http://stackoverflow.com/questions/128796/pretty-urls-for-search-pages) – Maks3w Apr 04 '14 at 20:47

2 Answers2

1

You need to use the mod_rewrite from apache2, it's a way for mask your parameters in a user friendly url.

You can read about thins in this tutorial: http://www.workingwith.me.uk/articles/scripting/mod_rewrite

full docs: http://httpd.apache.org/docs/2.2/rewrite/

Welington Veiga
  • 151
  • 1
  • 7
1

try this

RewriteEngine On
RewriteBase /

# make pretty urls work
RewriteRule ^dictionary/([^/]*)$ index.php?ml=$1 [L]

# redirect none-pretty urls
RewriteCond %{QUERY_STRING} ml=(.*)
RewriteRule ^$ /dictionary/%1 [L,R=302]

You'll also need some Javascript to catch the form's onsubmit, and change the url to not have the get parameters. You could do without, but that would result in an extra 302 request, and slow the pageload down a bit.

(PS make sure you php script return a 404 page if it can't find the word in the database.)

Gerben
  • 16,747
  • 6
  • 37
  • 56