0

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

enter image description here

Here is the .htaccess file screenshot. Please check the selected line

enter image description here

Please help me out... How will I do that...

1 Answer 1

2

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']}";
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.