3
Contributors
8
Replies
23
Views
4 Years
Discussion Span
Last Post by pritaeas
0

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.

0

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

...hp/threads/454418/display-name-in-url-from-sql

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

...hp/threads.php?id=454418

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

0

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...

0

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

0

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.

0

I'm no expert so bear with me:

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

I think may do it.

Edited by diafol

0

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

What makes you think that?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.