-1

I want to pass a variables from one php file to other php file by GET method only without showing in URL.

for example: http://www.mysite/test.php?user_id=1

Instead of this just need URL should be like http://www.mysite/test

How it can be possible?

Note: I am aware about $_SESSION, $_POST but all of them are also will show URL like test.php, that I do not need actually..

Al Foиce ѫ
  • 4,195
  • 12
  • 39
  • 49

1 Answers1

2

This should solve your purpose:

RewriteEngine                 On


RewriteCond             %{QUERY_STRING}        ^page=1$
RewriteRule                   (.*) $1?                         [R=permanent]

Use this for further reference: remove query string from end of url URL using .htaccess

Community
  • 1
  • 1
Indrasis Datta
  • 8,692
  • 2
  • 14
  • 32