Server Administration
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesServer Administration

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old April 7th, 2004, 11:13 PM
pickleman78 pickleman78 is offline
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Dallas,TX,USA
Posts: 582 pickleman78 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via AIM to pickleman78
Redirecting

Alright... Lets say I want to set something up, like php.net has(or codewlakers for that matter) where you can do php.net/funcname

Now, I doubt they have a directory for every function... How would I go about setting something like this up...

I guess more what I want is this...
Lets say I go to php.net/bob

It redirects me to
http://www.php.net/manual-lookup.php?pattern=bob&lang=en

How do you get that bob out of the URL and into another pages query URL section...

Reply With Quote
  #2  
Old April 8th, 2004, 08:09 PM
sliver's Avatar
sliver sliver is offline
Moderator
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: WI, USA
Posts: 906 sliver User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 1 h 17 m 15 sec
Reputation Power: 2
Send a message via AIM to sliver Send a message via XFire to sliver
RE: Redirecting

Actually, I think it's most likely Apache's mod_rewrite function.

Reply With Quote
  #3  
Old April 8th, 2004, 08:30 PM
pickleman78 pickleman78 is offline
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Dallas,TX,USA
Posts: 582 pickleman78 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via AIM to pickleman78
RE: Redirecting

Thats what I was afraid of....

tirdun: How would you do that?? If you are going to php.net/bob, the server should be looking for php.net/bob/index.php, which does not exist.... Unless I'm overlooking something there...

Reply With Quote
  #4  
Old April 9th, 2004, 03:06 PM
brut brut is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 367 brut User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 30 sec
Reputation Power: 2
RE: Redirecting

There is a fairly simple way to do this. Assuming you have access to your httpd.conf, or .htaccess:

1. Set a custom 404(not found) page:
Code:
ErrorDocument 404 /redirect.php


2. Create redirect.php
php Code:
Original - php Code
  1.  
  2. <?php
  3.  
  4. $term=$_SERVER['REDIRECT_URL'];
  5. header("Location: http://www.yourdomain.com/query.php?q=".$term);   
  6.  
  7. ?>


3. Create query.php
php Code:
Original - php Code
  1.  
  2. <?php
  3.  
  4. $q=preg_replace("/^/(.*)/","\1",$_GET['q']);
  5. echo "Cannot find info on: <b>".$q."</b>";
  6.  
  7. ?>


This will mimic the php.net behaviour, as near as I can tell, without mod_rewrite.

Reply With Quote
  #5  
Old April 9th, 2004, 03:20 PM
pickleman78 pickleman78 is offline
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Dallas,TX,USA
Posts: 582 pickleman78 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via AIM to pickleman78
RE: Redirecting

brut:Thats what I was looking for, I'll give this a try, thanks alot

Reply With Quote
  #6  
Old April 17th, 2004, 05:08 PM
pickleman78 pickleman78 is offline
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Dallas,TX,USA
Posts: 582 pickleman78 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via AIM to pickleman78
RE: Redirecting

Alright, so I haven't tested your method yet brut, but I think the webserver will let us use mod_rewrite, so is there perhaps a tutorial that someone can point me to that can help me learn to use mod_rewrite? Or if anyone could tell me how to write teh rule that would like map

www.website.com/members/1
to
www.website.com/members/index.php?id=1

or a tutorial would be great, just anything...

Reply With Quote
  #7  
Old April 17th, 2004, 07:58 PM
brut brut is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 367 brut User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 30 sec
Reputation Power: 2
RE: Redirecting

Here's the documentation, and here are some examples for different scenarios.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesServer Administration > Redirecting


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT