php - Clean URL with htaccess -


i new on forum, need help. i'm working on website php/mysql , stack .htaccess

so there code

<a href="namebook-'.$row['book_name'].'" class="btnmore">review</a> 

and there htaccess,

rewriteengine on rewritecond %{script_filename} !-f  rewritecond %{script_filename} !-d  rewriterule ^([^\.]+)$ $1.php [nc,l]  rewriterule ^book/namebook-([a-za-z0-9.\/\-\?\&]+)\.php$ book/namebook.php?name=$1 

and code url this: mywebsite.com/book/namebook-book1

so want clean url this: mywebsite/book/book1

sounds need remove namebook first part of url?

i.e. change this:

<a href="namebook-'.$row['book_name'].'" class="btnmore">review</a> 

to this:

<a href="'.$row['book_name'].'" class="btnmore">review</a> 

Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -