Yes, I know, there are tons of questions like this, but I can't find one which solves my problem so at cost of receiving downvotes I'm going to ask this again. Even a duplicate link may help me.
This is a job that I've never done before, I have this kind of URL demo.html?code=IT-ROM-FCO
where:
IT
is the IATA code for "Italy"ROM
is the IATA code for "Rome"FCO
is the IATA code for "Aeroporto di Roma Fiumicino".
I have to rewrite the above URL to display like this airports/italy/rome/aeroporto-di-roma-fiumicino
, the strings for the result are coming from an API service.
I know the simple rewrite to change products.php?id=7
to products/7
but I never done such task (get an URL - retrieve some data in PHP w/ the given code - "pretty" print the new URL)
As I really don't know how to achieve this job I have no code example, sorry.
airports/italy/rome/aeroporto-di-roma-fiumicino
into your web app and have it deal with the conversion.IT
,ROM
, andFCO
)? Are the dozens? Hundreds?code
parameter, the first iscode=IT-ROM
which shows all airports of Rome and there are about 9K cities... the full version iscode=IT-ROM-FCO
and shows data of a specified airport...about 16K of them. I think I'm going to insert another parameter calledalias
in the URL so I can retrieve it in.htaccess
and exclude the codes