Mod rewrite only domain name display on url?

Hello,

my link
http://www.domainname.com/user_detail.php?category_id=1&user_id=5

i want to when i click in alink url be http://www.domainname.com or http://www.domainname.com/user_detail.php i dont want to show parameters in url.

how can i do itis with mod_Rewrite , apache or php.

Thanks.
phparmyAsked:
Who is Participating?
 
RoonaanConnect With a Mentor Commented:
For this question to be answered you first need to have your requirements finalized.

Do you not want parameters in the url, or just not as a query string(query string is the questionmark and anything after: page.php?variables)

What are your preferred urls? Can you specify them?

1) domainname.com/user/{username} --> maps to user.php?username=username
2) domainname.com/profiles/{username} --> maps to profiles.php?username=username
3) ... etc

Kind regards

-r-

0
 
biztigerConnect With a Mentor Commented:
Save the file as .htaccess and place it on your root directory.
RewriteEngine On
RewriteBase /
RewriteRule ^(.+)/([0-9]+)/?$ user_detail.php?category_id=$1&user_id=$2
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
phparmyAuthor Commented:
but i need for all of my pages be like that not for specific pages.

sometimes can be  user_detail.php?id=1&category_id=2&name=Joe&exc.... or products.php?a=1&b[2]=1

extc...
0
 
biztigerConnect With a Mentor Commented:
Use multiple rewrite rule according to your need
0
 
phparmyAuthor Commented:
i dont want to show query string in url.  i want clean only domainname.com nothing user can see in url. is it possible.

i see it in .net projects. there is nothing on url. but site works correctly.
0
 
RoonaanConnect With a Mentor Commented:
You would have to use only POST request i guess or AJAX/Flash/Flex.
0
 
biztigerConnect With a Mentor Commented:
I think Roonan is correct. Create a frontpage and use Ajax or Flex Technology, or use an Iframe.
0
 
phparmyAuthor Commented:
i have solution for that. i encrypt urls and then again decrypt it for use.  mcrypt extension is good for that. but i am searching for like in .net projects when clicking any link you see its information in window.status but urls are clean. how they do it. is it posibble to do with mod_rewrite.  i dont want to use ajax and frame.
0
 
phparmyAuthor Commented:
Thanks everybody i cant found any solution. I will open this question later.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.