tags:

views:

93

answers:

3

I have problem to encrypt the url.

example

existing url= www.domainname/search.php?key=books&type=title&Submit=search

i want to encrypt this url.

encrypt url= www.domainname/keword-keyword-keyword.html

in this form...

can any one solve my problem.. i will be greatfull to him or her

+2  A: 

This is called Friendly URL: http://www.google.com/search?q=friendly+URL

TiuTalk
this url are example?
Sushant Panigrahi
@Sushant - No.. they're articles about how you can do that... It's just too long to explain here. :)
TiuTalk
+4  A: 

If you're using PHP, you may well be on an Apache server - in which case you can use Apache's mod_rewrite to provide restful URIs to your visitors.

Here is a short example:

RewriteEngine on
RewriteRule ^Search/([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ search.php?key=$1&type=$2&term=$3 [L,NC]

This would translate

http://www.domainname/Search/books/title/Mission%20Impossible/

Into

http://www.domainname/search.php?key=books&type=title&term=Mission%20Impossible

The [L] means no further rules would be evaluated The [NC] makes this case-insensitive (so "Search" and "search" would both work)

Sohnee
+1  A: 

It is also possible to use a PHP file as common part of the path and parse the request URI yourself. E.g.

http://www.example.com/index.php/books/AliceInWonderland

In this case, index.php could parse the $_SERVER['REQUEST_URI'].

Sjoerd