Reputation: 53
I just want to send slug of the blog in href. Code post_url = slug of that blog title
<h3><a href="<?= $base_url ?>blog/<?=$rowposts['post_url']?>">Read</a></h3>
Url will be this - http://localhost/Office/VTPL/Varneli%20HOME_CMS/vareli-home/blog/this-is-my-blog
Here is the .htaccess file screenshot. Please check the selected line
Please help me out... How will I do that...
Upvotes: 0
Views: 202
Reputation: 341
Replace your .htaccess line with this
RewriteRule ^blog/([A-Za-z0-9_-]+)/?$ blog/blog-details.php?post=$1 [L,QSA]
To get URL, PHP code
$full_url = "http://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
Upvotes: 2