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.

Coding Forum


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



Reply
Old 09-10-2004, 05:40 PM Mod_rewrite question
OnlyPhp.Com's Avatar
Extreme Talker

Posts: 177
Location: World
Trades: 0
Hello ,
I have a problem.
Code:
RewriteRule ^dirs-([0-9]+)-([0-9]+).html directory.php?ax=list&sub=$1&cat_id=$2
Whenever i try to do this . I mean the original url in the directory is :
directory.php?ax=list&sub=$id&cat_id=$id
The first $id is for subcat value
And the second $id is for main cat value. I tried to rewrite it using the code above however it only printed out this part :
directory.php?ax=list
I mean it didn't include the rest : &sub=$1&cat_id=$2

Let me tell you what I exactly want so someone might help.
This is the original link in the script :
directory.php?ax=list&sub=$1&cat_id=$2
I want to make it :
directory-1-2.html (The "1" is for the $sub value and the second is the $cat_id value)

Any help would be truly appreciated .

Best Regarsds,
Umut Kale
__________________

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


Please login or register to view this content. Registration is FREE
OnlyPhp.Com is offline
Reply With Quote
View Public Profile Visit OnlyPhp.Com's homepage!
 
 
Register now for full access!
Old 09-11-2004, 03:07 PM
KeithMcL's Avatar
Super Talker

Posts: 128
Location: Dublin, Ireland
Trades: 0
Try

Code:
RewriteRule ^directory-([0-9]+)-([0-9]+).html$ directory.php?ax=list&sub=$1&cat_id=$2 [L]
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
KeithMcL is offline
Reply With Quote
View Public Profile
 
Old 09-12-2004, 12:27 PM
OnlyPhp.Com's Avatar
Extreme Talker

Posts: 177
Location: World
Trades: 0
I actually found it.
It was because of :
directory.php?ax=list&sub=$1 part.
it only recognized the ?ax=list part. When I put the ax=list variable at the end (directory.php?sub=$1&ax=list) it worked.
__________________

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


Please login or register to view this content. Registration is FREE
OnlyPhp.Com is offline
Reply With Quote
View Public Profile Visit OnlyPhp.Com's homepage!
 
Old 09-12-2004, 02:04 PM
Republikin's Avatar
Defies a Status

Posts: 3,189
Trades: 3
It would seem to me that you have no rule to handle the ax=list part as none of these are numbers and your regex only says, match any numbers in here.
__________________

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


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


Please login or register to view this content. Registration is FREE
Republikin is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Mod_rewrite question
 

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