I'm having issues with passing a parameter over the url and I think it is related to the .htaccess file.
This page:
site.com/apprenticeships/current_vacancies
has a link to this page:
site.com/apprenticeships/current_vacancies?id=1
on the page I have:
$id = $_GET['id'];
echo $id;
and in the .htaccess file there is this line of code:
RewriteRule ^apprenticeships/([^/\.]+)/?$ content.php?page=$1
The page with the echo in does not echo out the id. Does anyone have an idea why ?
When
?something
is present in the second argument ofRewriteRule
(the part that defines what to rewrite to), then by default the query string is replaced. You want to combine both query strings, and you can do this with theQSA
(query string append) flag.