php - create clean url from ID but show name instead of ID -
php - create clean url from ID but show name instead of ID -
i trying create htaccess file clean urls
i have id , articlename columns in database
i trying creat clean urls : localhost/article.php?id=50 localhost/article/articlename/
is possible htaccess file?
i have code in article.php file
$article=$_request['article']; $getarticle = $db->get_rows("select * articles id=$article");
i have in htaccess file:
rewriterule ^article/([^/]*)$ /article.php?id=$1 [l]
there's no way utilize apache rewrite convert clean url numeric database id, best way accomplish add together new column database clean url value , utilize query string value instead.
then thing need alter in code utilize new column in sql query clause instead of id.
php apache .htaccess
Comments
Post a Comment