Mobile app version of vmapp.org
Login or Join
Voss4911412

: Pretty URLs for dynamic links generated based on a 3rd party soap web service We have a 3rd party web service which we interact with via Soap. In this regard we query the 3rd party for

@Voss4911412

Posted in: #Apache #UrlRewriting #WebServices

We have a 3rd party web service which we interact with via Soap. In this regard we query the 3rd party for resources, construct a home page and all links generated on this index page are referencing ID's of a 3rd party web service.

For example:

site.com/get.php?id=34bv43b34b3b34be //corresponds to "Service 1"
site.com/get.php?id=3443g43gg43g5h56 //corresponds to "Service 2"
and so on...


Being that these are referencing a resource on a 3rd party, how can I use mod_rewrite or something similar to construct nice URLs.

Something such as:

site.com/get/Service_1 //corresponds to site.com/get.php?id=34bv43b34b3b34be


Would we have to index these services and system ID's on our own site potentially in a database or something to achieve this?

Basically, what I want to know is can I do this without storing any additional data on our site? If not, I understand that I could have a cron job setup to periodically poll the 3rd party web service for changes and have a local database with services and system IDs but we would really like a solution that doesn't involve this.

Configuration:


php
apache
mysql


Can provide more details of our system configuration if needed.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Voss4911412

1 Comments

Sorted by latest first Latest Oldest Best

 

@Cofer257

Unless there is a way to generate the ID (34bv...) from the service name (Service_1) then you will need to store the data somewhere. Judging by the ID format it could be an md5 hash (or part of).

But it's not difficult to create a MySQL table with id/name fields and look them up on page load. If you are not already, you ought to be caching the data from the 3rd party service locally to avoid constant lookups.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme