a lot of website uses such url, but i don't know exactly did those website perform the query based on title or id (id might be a primary_key), i think it is bad practice if the query based on title isn't it?
It might be worth while looking at what blog systems these sites are using and looking at the source.
Example, if a site that is doing what you want is running wordpress, have a look at how wordpress does it.
Ive used a .htaccess file based on the wordpress seo friendly links for a while now and it works great but dosnt work quite how you want it to.
If your article titles are unique then you could just search from them in the url rather than id to begin with although im sure there is somthing wrong with that, that im missing.
.htaccess
RewriteEngine on
RewriteBase /
RewriteRule article/(.*)/$ index.php?category=article&linktitle=$1 [L]
And you write in you database a field name linktitle, and your select would be like this.
select * from articles where linktitle='".$_REQUEST['linktitle']."'";
__________________
Please login or register to view this content. Registration is FREE - FileREX.com is an internet download website, from where you can download high-quality software.
It might be worth while looking at what blog systems these sites are using and looking at the source.
Example, if a site that is doing what you want is running wordpress, have a look at how wordpress does it.
Ive used a .htaccess file based on the wordpress seo friendly links for a while now and it works great but dosnt work quite how you want it to.
If your article titles are unique then you could just search from them in the url rather than id to begin with although im sure there is somthing wrong with that, that im missing.