htaccess rewrite rule to add another parameter to url query string or use php to handle?

孤者浪人 提交于 2020-02-08 01:30:12

问题


My question is, How do I redirect my old query string urls to the new query string urls.

Examples below:

I have updated my query string in url like so

computerhelpwanted.com/jobs/?position=Oracle+Developer

to the following

computerhelpwanted.com/jobs/?occupation=Developer&position=Oracle+Developer

Sometimes the query string structure is like this with a - separating the words.

computerhelpwanted.com/jobs/?position=data-analyst

and on rare instances it is like this

computerhelpwanted.com/jobs/?position=tech-support+or+it-support+or+support-technician+or+support-tech

Most of the time it is the + separating the words. And in most cases the 11 occupations that can be selected will be on the end of the query string parameter like in the example for position=Oracle+Developer. Where Developer is the occupation.

Any help on this in mod rewrite and/or php I'd be very grateful.

来源:https://stackoverflow.com/questions/26034580/htaccess-rewrite-rule-to-add-another-parameter-to-url-query-string-or-use-php-to

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!