I want to create SEO urls for my blogs my blog url is like
http://localhost/test/blog.php?blogId=5 i want to convert it to blogs title.
I am currently trying this in .htaccess page but this didn’t work
RewriteEngine On
RewriteRule ^([a-zA-Z0-9_-]+)$ profile.php?u=$1
RewriteRule ^([a-zA-Z0-9_-]+)/$ profile.php?u=$1
RewriteEngine ON
RewriteRule ^([a-zA-Z0-9_-]+)$ blog.php?blogId=$1
RewriteRule ^([a-zA-Z0-9_-]+)/$ blog.php?blogId=$1
weird thing is that I tried a similar code for user id’s and it worked.
2
Answers
Try writing it this way…
A link to a userid would look like
/2
A link to a blog article would look like
/2/