What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » mod_rewrite help

mod_rewrite help
Author: Message:
Dempsey
Scripting Contest Winner
*****

Avatar
http://AdamDempsey.net

Posts: 2395
Reputation: 53
37 / Male / Flag
Joined: Jul 2003
O.P. Undecided  mod_rewrite help
Anyone any good at mod rewrite?  I've having a few problems at mpsounds.net.

What I'm trying todo is:

/soundpacks/category/english  -->  /soundpacks.php?nonsearch=1&cat=english 

/soundpacks/category  -->  /soundpacks.php?nonsearch=1&catid=-1

/soundpacks  -->  /soundpack.php 

.htaccess
code:
RewriteRule ^soundpacks/category/(.+) soundpacks.php?nonsearch=1&cat=$1 [nc]
RewriteRule ^soundpacks/category soundpacks.php?nonsearch=1&catid=-1 [nc]
RewriteRule ^soundpacks soundpacks.php [nc]

/soundpacks/category/english and /soundpacks both work, but /soundpacks/category doesn't.  I don't really understand why.  Any ideas?
SoundPacks   -   Scripts   -   Skins

that's not a bug, thats an unexpected feature
08-08-2007 06:36 PM
Profile E-Mail PM Web Find Quote Report
Nathan
Veteran Member
*****

Avatar
Yeah, "large dimensions" ;)

Posts: 2984
Reputation: 76
– / Male / Flag
Joined: Apr 2005
RE: mod_rewrite help
Maybe something like: (for the first one)
RewriteRule ^soundpacks/category/engligh/([a-z0-9]+)/$ soundpacks.php?nonsearch=1&cat=english


RewriteRule ^soundpacks/category/([a-z0-9]+)/$ soundpacks.php?nonsearch=1&catid=-1


RewriteRule ^soundpacks/([a-z0-9]+)/$ soundpacks.php




thats should do it :)
Touch Innovation - touch friendly programs/applications for the windows mobile!


08-08-2007 06:52 PM
Profile E-Mail PM Web Find Quote Report
WDZ
Former Admin
*****

Avatar

Posts: 7106
Reputation: 107
– / Male / Flag
Joined: Mar 2002
RE: mod_rewrite help
I copied and pasted your rules and they worked fine for me... :/

[Image: attachment.php?pid=841812]

Did you notice that you have 2 different variable names, cat and catid? :p

quote:
Originally posted by Napbree
RewriteRule ^soundpacks/category/engligh/([a-z0-9]+)/$ soundpacks.php?nonsearch=1&cat=english
Umm, I think the point is for the category ('english' for example) to be dynamic. =p

.png File Attachment: modrewrite.png (23.82 KB)
This file has been downloaded 181 time(s).
08-09-2007 02:21 AM
Profile PM Web Find Quote Report
Dempsey
Scripting Contest Winner
*****

Avatar
http://AdamDempsey.net

Posts: 2395
Reputation: 53
37 / Male / Flag
Joined: Jul 2003
O.P. RE: mod_rewrite help
quote:
Originally posted by WDZ
I copied and pasted your rules and they worked fine for me... :/
Oh maybe its not the rewrite thats the prob then its my php :P
quote:
Originally posted by WDZ
Did you notice that you have 2 different variable names, cat and catid? :P
Yea catid is a number and cat is text, is because I've recently changed it to remove nubmbers from the url, eg /soundpacks/1_english
SoundPacks   -   Scripts   -   Skins

that's not a bug, thats an unexpected feature
08-09-2007 07:21 AM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On