I have this working rule:
RewriteRule ^(.*)/amp/$ https://example.com/$1?amp=1 [QSA,R=301,NC,NE,L]
For redirecting https://example.com/register/amp/
to https://example.com/register?amp=1
.
And it is working well, but I would like that the URL in the browser didn't change so it will load the register?amp=1
, but in browser still show /register/amp/
.
To achieve this behaviour, I try modifying to:
RewriteRule ^(.*)/amp/$ ./app.php/$1?amp=1 [QSA,R=301,NC,NE,L]
But then it redirects to https://example.com/home/user/public_html/register?amp=1
.
So it is adding the document root wrongly and I don't know how to modify the rule to achieve that.