I have 2 files called "free.php" and "new.php".
for example consider, The free.php contains Hi, $_GET['s']. new.php contains Hello, $_GET['s'].
I get URLs like https://website.com/free/file-access from https://website.com/free?s=file-access and
https://website.com/new/john-smith from https://website.com/new?s=john-smith. that's fine.
but I have an issue with the result. https://website.com/new/john-smith loads "free.php" file code with "s=john-smith" values. I received "Hi john-smith" what I need is "Hello John-smith"
when I run free.php i want results like "Hi, file-access" ( URL be like : https://website.com/free/file-access)
when I run new.php i want results like "Hello, john-smith" (URL be like : https://website.com/new/john-smith)
my htaccess code is
RewriteCond %{THE_REQUEST} \s/(free)\?s=([^\s]+)\s [NC]
RewriteRule ^ /%1/%2? [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(?:[^/]*)/(.*)/?$ free.php?s=$1 [NC,QSA,L]
RewriteCond %{THE_REQUEST} \s/(new)\?s=([^\s]+)\s [NC]
RewriteRule ^ /%1/%2? [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(?:[^/]*)/(.*)/?$ new.php?s=$1 [NC,QSA,L]
.PHP removed using previous httacess code.
Please help me to solve this issue. thank you in advance.