Current location: Hot Scripts Forums » Other Discussions » Web Servers » Apache, redirect script


Apache, redirect script

Reply
  #1 (permalink)  
Old 03-25-08, 01:38 AM
lylesback2 lylesback2 is offline
Wannabe Coder
 
Join Date: Dec 2003
Posts: 119
Thanks: 0
Thanked 0 Times in 0 Posts
Apache, redirect script

I currently have a web site, where I want the user to be able to type in
www.website.com/foo and then have a page search the database for the word "foo" in a specified "Name" field, and return the ID number, then re-direct to that persons page, which is stored in a Profile.php?id=IDNUMBER

I was wondering how I can go about with the .htaccess file, and creating the php script page for this.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 03-26-08, 04:30 AM
Jay6390's Avatar
Jay6390 Jay6390 is offline
Code Master
 
Join Date: Apr 2007
Location: United Kingdom
Posts: 1,330
Thanks: 0
Thanked 0 Times in 0 Posts
You will need to use mod_rewrite. There's thousands of examples out there. I would suggest you use an identifier to determine that it is for a search rather than being directly after your domain, such as www.website.com/profile/foo. The reason is to prevent confusion when requesting normal pages such as www.website.com/index.php etc and it searching for index.php in your database rather than bringing up your homepage

Jay
__________________
Useful Tutorials
[ PHP Video-1-2-3 ] [ MySQL 1-2-3 ]
For any php function reference type

www.php.net/FunctionName
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Submit button....can it send info to my email w/out the use of php???? lisa33 HTML/XHTML/XML 7 10-17-06 12:46 PM
Login Script v1.9 Problem SuavyDoodle JavaScript 8 09-28-06 10:13 PM
Login and Redirect user script alistairgd Script Requests 4 01-03-05 04:30 PM
Pre-load Image Script then Redirect? thefoxbox PHP 3 11-25-04 03:29 PM
Is there any integrity of script rankings? webmaster@atmanager.com Hot Scripts Forum Questions, Suggestions and Feedback 17 08-06-04 01:12 AM


All times are GMT -5. The time now is 07:11 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.