?
Solved

Mod rewrite only domain name display on url?

Posted on 2008-11-14
10
Medium Priority
?
545 Views
Last Modified: 2012-05-05
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.
0
Comment
Question by:phparmy
  • 4
  • 4
  • 2
10 Comments
 
LVL 8

Assisted Solution

by:biztiger
biztiger earned 500 total points
ID: 22958856
0
 
LVL 8

Assisted Solution

by:biztiger
biztiger earned 500 total points
ID: 22958880
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
 

Author Comment

by:phparmy
ID: 22958897
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 8

Assisted Solution

by:biztiger
biztiger earned 500 total points
ID: 22966014
Use multiple rewrite rule according to your need
0
 
LVL 49

Accepted Solution

by:
Roonaan earned 500 total points
ID: 22970025
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
 

Author Comment

by:phparmy
ID: 22973663
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
 
LVL 49

Assisted Solution

by:Roonaan
Roonaan earned 500 total points
ID: 22974197
You would have to use only POST request i guess or AJAX/Flash/Flex.
0
 
LVL 8

Assisted Solution

by:biztiger
biztiger earned 500 total points
ID: 22974360
I think Roonan is correct. Create a frontpage and use Ajax or Flex Technology, or use an Iframe.
0
 

Author Comment

by:phparmy
ID: 22974513
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
 

Author Comment

by:phparmy
ID: 23010973
Thanks everybody i cant found any solution. I will open this question later.
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses
Course of the Month17 days, 4 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question