How can i hide query string contents from URL through PHP?.
i.e if i have "posting.php?mode=post&f=1"
I want to write it as posting
HOw it can be done in PHP.
KIndly help me for this.
Thank you.
Need help about hiding URL contents in PHP
Moderator: General Moderators
Re: Need help about hiding URL contents in PHP
URL rewrite is your friend. Or POST the url instead of GET.
Re: Need help about hiding URL contents in PHP
If i want to have link then after cliking on link the query string will be shown in URL but i dont want it to be shown in URL.
Like if after clicking on link URL is
"posting.php?mode=post&f=1"
But i want to show it as
"posting"
How it can be done for link click.. ?
Like if after clicking on link URL is
"posting.php?mode=post&f=1"
But i want to show it as
"posting"
How it can be done for link click.. ?
-
BornForCode
- Forum Contributor
- Posts: 147
- Joined: Mon Feb 11, 2008 1:56 am
Re: Need help about hiding URL contents in PHP
Please give also the apache version:
Or you can use
Or (i recommend you this one)
Code: Select all
RewriteEngine On
RewriteRule (.*)\.html $1 [R=301,L]
Code: Select all
RewriteEngine on
RewriteBase /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^.]+)\.html\ HTTP
RewriteRule ^([^.]+)\.html$ http://www.domain.com/$1 [R=301,L]
Code: Select all
RewriteEngine on
RewriteCond %{REQUEST_URI} !(\.[^./]+)$
RewriteCond %{REQUEST_fileNAME} !-d
RewriteCond %{REQUEST_fileNAME} !-f
RewriteRule (.*) /$1.html [L]
Re: Need help about hiding URL contents in PHP
Thank you very much for help.