I'm working on a site where for SEO reasons I need to have around 50 pages all with the same content, but with certain words swapped out based on the URL. The certain words are all locations (i.e UK, Spain, France etc). So the content on the page will say "personal training courses UK or personal training courses Spain, personal training courses France).
Currently I have it so the URL is www.websitename.com/courses.php?location=uk. Then on the courses.php page I'm doing a $_GET to get the location parameter and then changing the content of the page based on this. Ideally what I really want is for the URL to be www.websitename.com/courses/uk, www.websitename.com/courses/spain mainly for aesthetic reasons. Is there a rewrite rule to achieve this? I'm also open to alternatives so I can get the location in the URL using other methods to $_get.