Copy link to clipboard
Copied
I'm working on a project that is going to involve each property currently stored in a database having its own page.
The way I'm used to doing it (using PHP and mySQL) would be to have a page listing the properties, and a details page of the form:
www.mywebsite.com/property_details.php?PropertyID=101
Is there any way of having a URL of the form:
www.mywebsite.com/propertyname/
?
Copy link to clipboard
Copied
You can use the rewrite engine. However, the engine needs to be able to convert a friendly name to the dynamic page parameter. So, you could either convert the PropertyID from numeric to a string value to hold the propertyname, or better, add a new unique column to the database for the PropertyName and modify the property_details.php script to retrieve the property by that column.
Copy link to clipboard
Copied
Thanks for that - I did have a rummage last night and found some stuff about the rewrite engine.I got as far as seeing it needed some Apache thing to be running, and checked on a phpinfo.php page and saw that it wasn't, so I've fired off an email to the hosting company to see if its something that can be set up on the server.
If all else fails, as the pages will all be the same, and subject to how many are needed, I guess I can always create a page for each, and just change the SQL query in each to pull the data from the required record.