0

i have a property website where alot of properties have been uploaded, presently the url of a property looks like this

http://propertyonline.com.ng/property.php?product_id=255

But for the sake of google optimization i know it should not remain like this so i am try to rewrite my url to something clean like the title of the property.

i want to append the title of each property on the page to the property url

so instead of e.g

http://propertyonline.com.ng/property.php?product_id=255

we will have

http://propertyonline.com.ng/3 Bedroom Flat Large Compound On Banana Island Ikoyi

i have a variable that presently echos the title of the property when on this page dynamically based on the id of the property as above

<?php  echo $row_prop['title']; ?>

Please how can i rewrite the url dynamically using htaccess

thanks

  • Possible duplicate of [URL rewriting with PHP](https://stackoverflow.com/questions/16388959/url-rewriting-with-php) – iainn Jan 08 '18 at 11:23
  • ok thanks, but i need to change that title based on the product id of that page how do i do this, the example in the link u gv me is static – oluwagarri me Jan 08 '18 at 11:26
  • This is not as trivial as you think it is. Right now, your script/system is most likely using the passed product id, 255, to look up the corresponding content from the database. But in your given desired URL, you have completely removed that id - so you will need to modify your logic to look up the content accordingly … – CBroe Jan 08 '18 at 12:30

0 Answers0