I am having a list of members in my database, which i want to display in my website.

I am using php GET method, and the sample url is


Can anyone please help me in getting url like


I may not describe my question properly, but, hope you can understand...
Thanking you..

Member Avatar

This depends about the munna_bharadwaj bit.
Apache mod_rewriting can take care of the number bit easily enough.

You could do something like this:

RewriteEngine On
RewriteRule ^munna_bharadwaj_([^/]*)/$ /display.php?id=$1 [L]

But I suspect you'd want a different name/term for each number?

BTW this 'code' won't change the original url, it will just allow the smarter url to be read as the original.

"munna bharadwaj" is the name...
for example, see the url of this page, It is


I want this type of url...
but, in my trails, i am getting


I want the php code for the first mentioned kind of urls...

Member Avatar

OK, I see. Like Daniweb?

Yes, and, actually many websites use the same, especially the e commerce websites. Using that kind of URLs will make my website and database a bit safe from hackers. So, can you/ anyone help me in getting urls like that...

ok, i understood your explaaination, you mean to add ".htaccess file" right..? thank you... :)

Member Avatar

THe title AFAIK is not essential to the url - maybe for SEO purposes. Yep the .htaccess file will be handling the rewrite. Remember you will be writing the smart urls into your pages and then .htaccess allows the server to make sense of them, i.e. extract the parameters.

Member Avatar

I'm no expert so bear with me:

RewriteRule ^/([^/]*)/[^/]*/$ /threads.php?id=$1 [L]

I think may do it.

Using that kind of URLs will make my website and database a bit safe from hackers.

What makes you think that?