I have a website uses wildcard*
i made a custom page called custom-page.php
i used this code to access to this custom page
RewriteCond %{THE_REQUEST} \h/custom-page\h
RewriteCond %{REQUEST_URI} !^/custom-page\.php
RewriteCond %{HTTP_HOST} ^([^\.]+)\.domain\$
RewriteRule ^ x.php?id=%1 [L]
My problem :
this code makes this url :
subdomain.domain/custom-page
works fine and access my custom-page.php
but also when you type
subdomain.domain/custom-page.php?id=subdomain
it access too
What i Need :
what i need is when user enters this url
subdomain.domain/custom-page.php?id=subdomain
it automatics redirect him to
subdomain.domain/custom-page
how can i modify this code