Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
the best way to do a php URL Rewrite
Old 12-15-2005, 07:38 AM the best way to do a php URL Rewrite
madkad's Avatar
madkad-hosting.com

Posts: 310
Location: UK
Trades: 0
Hi

does any one have a good way to do a php url rewrite like

www.domain.com/help/helpphp.php?do=newthread&f=78=#$whatsnew&&fr=8976& =fr=frwhatever&&&=#3443$dont=&know&what=$i=am$&=do inghere=&=$%


to

www.domain.com/help/need-help-look-here.htm

LOL i have seen site but they just send my head funny any help on this matter would be great
madkad is offline
Reply With Quote
View Public Profile Visit madkad's homepage!
 
 
Register now for full access!
Old 12-15-2005, 08:40 AM
Skilled Talker

Posts: 70
Trades: 0
use mod_rewrite for apache?
cerebro89 is offline
Reply With Quote
View Public Profile
 
Old 12-15-2005, 09:12 AM
madkad's Avatar
madkad-hosting.com

Posts: 310
Location: UK
Trades: 0
hmm i was thinking that but i am not to up on Apache
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Great Hosting For You
madkad is offline
Reply With Quote
View Public Profile Visit madkad's homepage!
 
Old 12-15-2005, 09:19 AM
Skilled Talker

Posts: 70
Trades: 0
hmm possibly hyperwave however it's not free software so i'm stumped. will google it though

PS: did you manage to take a look at my PM?
cerebro89 is offline
Reply With Quote
View Public Profile
 
Old 12-15-2005, 09:29 AM
madkad's Avatar
madkad-hosting.com

Posts: 310
Location: UK
Trades: 0
LOL i want to be able to make the script my self just dont know were to start with it

yes i replyed to your post
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Great Hosting For You
madkad is offline
Reply With Quote
View Public Profile Visit madkad's homepage!
 
Old 12-15-2005, 08:11 PM
Experienced Talker

Posts: 46
Trades: 0
Apache mod_rewrite is the best way to go. You can 'fake it' with a php script, but it'll drain resources and slow page loads for your visitors a lot more.

There's a decent 'mod-rewrite for dummies' article here if you're new to it:
http://www.ecauldron.com/web/design020.php

HTH,
Scott
__________________
Take control of your Niche Sites & Parked Domains to earn
Please login or register to view this content. Registration is FREE
you deserve!
scott bannon is offline
Reply With Quote
View Public Profile
 
Old 12-16-2005, 07:27 AM
Skorch1's Avatar
Super Talker

Posts: 115
Location: California
Trades: 0
I would use Apache Mod-Rewrite. I even found automatic generators for this but didn't like the result. I just made an imaginary folder, assigned it to be rewritten and used
PHP Code:
$ask=$_SERVER['request_uri'];
$array=explode("/",$ask); 
to get the vars from my URL for my database query. they're contained in the array called $ask

This is the generic rewrite rule. It matches any charactor found between the brackets.
Code:
Options -indexes
Options +FollowSymLinks
RewriteEngine on
RewriteRule bin/(.*)/(.*)/(.*)$ /$3?section=$1&page=$2
There are better ways to match an expression this is the easiest, also called laziest, way. The parentheses make a group the first group is referred to as 1 the second group is two and etc.

your-site.com/bin/query-value1/query-value2/page.name

is now equivalent too

your-site.com/page.name?section=query-value1&page=query-value2

Have Fun! side note the file in group three must exist in the folder you specify. If you want to use an sub-directory you must use /path/to/folder/$3?section=$1&page=$2 instead of /$3?section=$1&page=$2
__________________
Check out my
Please login or register to view this content. Registration is FREE
website!

Last edited by Skorch1; 12-16-2005 at 07:32 AM..
Skorch1 is offline
Reply With Quote
View Public Profile Visit Skorch1's homepage!
 
Old 12-16-2005, 07:44 AM
madkad's Avatar
madkad-hosting.com

Posts: 310
Location: UK
Trades: 0
thank you that is great will give it ago
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Great Hosting For You
madkad is offline
Reply With Quote
View Public Profile Visit madkad's homepage!
 
Old 12-17-2005, 04:57 AM
akratellio's Avatar
Experienced Talker

Posts: 30
Location: Berlin Germany Europe World
Trades: 0
hi madkad,

maybe this php function is something for you:
parse_url(url),
his function split up the url you put in.

mfg
akratellio
__________________
I'm always lying...
Ich lüge immer...

Please login or register to view this content. Registration is FREE
akratellio is offline
Reply With Quote
View Public Profile Visit akratellio's homepage!
 
Old 12-17-2005, 05:56 AM
madkad's Avatar
madkad-hosting.com

Posts: 310
Location: UK
Trades: 0
Quote:
Originally Posted by akratellio
hi madkad,

maybe this php function is something for you:
parse_url(url),
his function split up the url you put in.

mfg
akratellio
Thank you thats great i will look into that
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Great Hosting For You
madkad is offline
Reply With Quote
View Public Profile Visit madkad's homepage!
 
Reply     « Reply to the best way to do a php URL Rewrite
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.45925 seconds with 12 queries