I'm having issues with passing a parameter over the url and I think it is related to the .htaccess file.
has a link to this page:
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 ?Answer1:
?something is present in the second argument of
RewriteRule (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 the
QSA (query string append) flag.
RewriteRule ^apprenticeships/([^/\.]+)/?$ content.php?page=$1 [QSA,L]