I’m trying to get below URL to do a redirect / rewrite
http://www.domain.com.au/posting?id=44404
Below is what is required:
http://www.domain.com.au/state/category/job_title
Is there a way to do this with PHP MySQL Joomla application?
This is using custom component so I have to retrieve state, category and job_title information from MySQL database. Is there a way to insert them into htaccess or recognise so that it reflects on the URL field instead?
Thanks
If you can write a script to get from
/state/category/job_titleto an id, then you can use a RewriteMap. You can only define a map in either the server config or a vhost config, not in an.htaccessfile.Say you had a perl script that parsed out the state, category, and job_title, did some database lookups, then output
44404or whatever the id is. Then you can define the mapping like so:Then in the
htaccessfile in your document root, you can use the map:If you wanted to enumerate every
state/category/job_titlecombination, you could also use a text file or a dbm file. Or if you have mod_dbd loaded and configured, you can also use a SQL select queryAnother alternative is to write some kind of php script and route everything through that. It would essentially be doing what the
script.plexample would do, parse out thestate/category/job_titlefields, and do the proper database lookup to obtain an id. You could then include the posting script and hand over the id.