How to hide query string in url with .htaccess

Thread Solved

Join Date: Jul 2008
Posts: 1,072
Reputation: Shanti Chepuru is on a distinguished road 
Solved Threads: 98
Shanti Chepuru's Avatar
Shanti Chepuru Shanti Chepuru is offline Offline
Veteran Poster

How to hide query string in url with .htaccess

 
0
  #1
Feb 25th, 2009
Hello...
Good Morning All...

How to hide all query strings in my url and here i can't use hidden variables for these all because in all times i couldn't send them with form submission..And my page is having four query strings to be sent...

If any body have any clues or information about this...
Please i request you to place here...

Thanks in Advance...
Shanti.
Last edited by Shanti Chepuru; Feb 25th, 2009 at 12:43 am.
Be intelligent, But Don't try to cheat.. Be innocent But Don't get cheated..
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,472
Reputation: cwarn23 has a spectacular aura about cwarn23 has a spectacular aura about cwarn23 has a spectacular aura about 
Solved Threads: 136
cwarn23's Avatar
cwarn23 cwarn23 is offline Offline
Nearly a Posting Virtuoso

Re: How to hide query string in url with .htaccess

 
1
  #2
Feb 25th, 2009
Do you meen something like sessions. Sessions will allow you to pass variables between pages and are very simple to use. Simple place at the very top of your pages that use sessions the following code:
  1. <?
  2. session_start();
Then below is an example of how to use the session array:
  1. <?
  2. session_start();
  3.  
  4. $_SESSION['variable_name']='apple';
  5. $_SESSION['testing']='orange'.
  6. ?>
  7. <a href='page2.php'>Page 2</a>
Then page2.php
  1. <?
  2. session_start();
  3.  
  4. echo $_SESSION['variable_name'];
  5. echo " is different to a ";
  6. echo $_SESSION['testing'];
  7. ?>
Try not to bump 10 year old threads as it can be really annoying.
Like php then read my website at http://syntax.cwarn23.net/
Star-Trek-Atlantis - now that's what I call a movie ^_^
My favourite PC. - MacGyver Fan
Bad english note: dis-iz-2b4u
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 1,072
Reputation: Shanti Chepuru is on a distinguished road 
Solved Threads: 98
Shanti Chepuru's Avatar
Shanti Chepuru Shanti Chepuru is offline Offline
Veteran Poster

Re: How to hide query string in url with .htaccess

 
0
  #3
Feb 26th, 2009
No...
thanks for your quick reply...

Is it possible with rewriting concept...

And one more thing..
should i use only one .htaccess file to access all of my folders in mysite.. And how to use rewrite conditions..

Thanks in advance...
Be intelligent, But Don't try to cheat.. Be innocent But Don't get cheated..
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 1,402
Reputation: ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light 
Solved Threads: 225
Sponsor
ShawnCplus's Avatar
ShawnCplus ShawnCplus is offline Offline
Code Monkey

Re: How to hide query string in url with .htaccess

 
0
  #4
Feb 26th, 2009
You could just use form method POST
GCS d- s+ a-->? C++(++++) UL+++ P+>+++ L+++ E--- W+++
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 1,330
Reputation: almostbob has a spectacular aura about almostbob has a spectacular aura about 
Solved Threads: 162
almostbob's Avatar
almostbob almostbob is offline Offline
Nearly a Posting Virtuoso

Re: How to hide query string in url with .htaccess

 
0
  #5
Feb 26th, 2009
checkout the apache.org mod_rewrite tutorials
Failure is not an option It's included free
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it

Please mark solved problems, solved
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 1,072
Reputation: Shanti Chepuru is on a distinguished road 
Solved Threads: 98
Shanti Chepuru's Avatar
Shanti Chepuru Shanti Chepuru is offline Offline
Veteran Poster

Re: How to hide query string in url with .htaccess

 
0
  #6
Feb 26th, 2009
thanks for all inputs..
Any more clear information about this????

I am struggling about this....
Last edited by Shanti Chepuru; Feb 26th, 2009 at 5:56 am.
Be intelligent, But Don't try to cheat.. Be innocent But Don't get cheated..
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,472
Reputation: cwarn23 has a spectacular aura about cwarn23 has a spectacular aura about cwarn23 has a spectacular aura about 
Solved Threads: 136
cwarn23's Avatar
cwarn23 cwarn23 is offline Offline
Nearly a Posting Virtuoso

Re: How to hide query string in url with .htaccess

 
0
  #7
Feb 26th, 2009
Well I just don't see how it is possible to use a htaccess file to hide the url info unless you have a dedicated virtual file for each possible input variable.
Try not to bump 10 year old threads as it can be really annoying.
Like php then read my website at http://syntax.cwarn23.net/
Star-Trek-Atlantis - now that's what I call a movie ^_^
My favourite PC. - MacGyver Fan
Bad english note: dis-iz-2b4u
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 1,072
Reputation: Shanti Chepuru is on a distinguished road 
Solved Threads: 98
Shanti Chepuru's Avatar
Shanti Chepuru Shanti Chepuru is offline Offline
Veteran Poster

Re: How to hide query string in url with .htaccess

 
0
  #8
Feb 26th, 2009
unless you have a dedicated virtual file for each possible input variable. Means???
Last edited by Shanti Chepuru; Feb 26th, 2009 at 8:05 am.
Be intelligent, But Don't try to cheat.. Be innocent But Don't get cheated..
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,472
Reputation: cwarn23 has a spectacular aura about cwarn23 has a spectacular aura about cwarn23 has a spectacular aura about 
Solved Threads: 136
cwarn23's Avatar
cwarn23 cwarn23 is offline Offline
Nearly a Posting Virtuoso

Re: How to hide query string in url with .htaccess

 
0
  #9
Feb 26th, 2009
means for each possible hidden value, there would need to be a different file path.
Try not to bump 10 year old threads as it can be really annoying.
Like php then read my website at http://syntax.cwarn23.net/
Star-Trek-Atlantis - now that's what I call a movie ^_^
My favourite PC. - MacGyver Fan
Bad english note: dis-iz-2b4u
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 596
Reputation: buddylee17 has a spectacular aura about buddylee17 has a spectacular aura about 
Solved Threads: 125
buddylee17's Avatar
buddylee17 buddylee17 is offline Offline
Posting Pro

Re: How to hide query string in url with .htaccess

 
1
  #10
Feb 26th, 2009
Rewrite rules don't actually hide the query string. Rewrite rules pretty much convert seo friendly urls into the actual query string.
Example .htaccess:
  1. RewriteEngine on
  2. RewriteRule ([^/\.]+)/?.html$ viewPage.php?ID=$1 [L]
The above rewrite rule will allow you to do something like this:
url reads: yoursite.com/DaniWeb.html
apache interprets as: yoursite.com/viewPage.php?ID=DaniWeb
Therefore
  1. <?php
  2. $id=$_GET['ID'];
  3. echo $id;
  4. ?>
will output DaniWeb.
Lost time is never found again.
- Benjamin Franklin
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC