Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

URL form - www.mywebsite.com/propertyname/

Enthusiast ,
Nov 09, 2011 Nov 09, 2011

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/

?

TOPICS
Server side applications

Views

485
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 09, 2011 Nov 09, 2011

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.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Nov 10, 2011 Nov 10, 2011

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines