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
Dynamic URLs from Static URLs
Old 01-02-2010, 08:08 PM Dynamic URLs from Static URLs
MoForce's Avatar
Super Talker

Posts: 145
Name: Jack Shalt
Trades: 0
I've got a PHP based site and am trying to figure out how to do a mod_rewrite based on conditions...

if someone puts in http://url.com/title/id/58

I'm trying to create a condition statement that first checks if "id" is present then create a new url: http://url.com/index.php?id=58

so if the static url is http://url.com/title/58 a dynamic url should now be generated

Thanks

btw, are there any good sites out there to learn how to do this kind of thing?
MoForce is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-03-2010, 10:53 AM Re: Dynamic URLs from Static URLs
Average Talker

Posts: 24
Location: Germany
Trades: 0
Quote:
Originally Posted by MoForce View Post
I've got a PHP based site and am trying to figure out how to do a mod_rewrite based on conditions...

if someone puts in http://url.com/title/id/58

I'm trying to create a condition statement that first checks if "id" is present then create a new url: http://url.com/index.php?id=58

so if the static url is http://url.com/title/58 a dynamic url should now be generated

Thanks
The code should look somewhat like this:
Code:
RewriteRule /title/id/([0-9]+)$ /index.php?id=$1
Quote:
btw, are there any good sites out there to learn how to do this kind of thing?
Yeah, I recommend you to read http://articles.sitepoint.com/articl...-url-rewriting.
__________________

Please login or register to view this content. Registration is FREE
- Register Now and Share Your Thoughts to Create Innovation and Wisdom


Please login or register to view this content. Registration is FREE
- Psychology, Philosophy and Self Development


Please login or register to view this content. Registration is FREE
- Read About All Those Things That Bug Me
Trey Walter is offline
Reply With Quote
View Public Profile Visit Trey Walter's homepage!
 
Reply     « Reply to Dynamic URLs from Static URLs
 

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.10030 seconds with 12 queries