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. Mod_Rewrite Help
On the old MPSounds site SoundPacks were linked to like

www.mpsounds.net/?id=pack&id2=342,

but now they are like

www.mpsounds.net/soundpack.php?id=342


There seems to be quite a few links to the old soundpack style so I am getting a lot of 404 errors in my logs.

I'm trying to add a Mod_Rewrite rule, but so far with no luck, just wondering if anyone can help?

This is what I've tried:
code:
RewriteEngine on
RewriteRule ^\?id=pack&id2=([0-9]+)$ soundpack.php?id=$1 [R]
SoundPacks   -   Scripts   -   Skins

that's not a bug, thats an unexpected feature
09-06-2006 10:30 AM
Profile E-Mail PM Web Find Quote Report
rav0
Veteran Member
*****

Avatar
i have an avatar

Posts: 1419
Reputation: 29
34 / Male / Flag
Joined: Aug 2003
RE: Mod_Rewrite Help
Try this out:

code:
RewriteEngine on
RewriteRule /?id=pack&id2=(.*)$ /soundpack.php?id=$1 [R=301,L]


I'm not sure if it works :).
| [Image: dorsh] |

(\ /)
(O.o)
(> <)

This is Bunny. Copy Bunny into your signature to help him on his way to world domination
09-06-2006 11:00 AM
Profile E-Mail 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 rav0
RewriteRule /?id=pack&id2=(.*)$ /soundpack.php?id=$1 [R=301,L]
Na still doesnt wanna work :(
SoundPacks   -   Scripts   -   Skins

that's not a bug, thats an unexpected feature
09-06-2006 11:05 AM
Profile E-Mail PM Web Find Quote Report
alexp2_ad
Scripting Contest Winner
****

Avatar
Who love the chocolate?

Posts: 691
Reputation: 26
36 / Male / –
Joined: May 2004
Status: Away
RE: Mod_Rewrite Help
code:
RewriteCond %{QUERY_STRING} ^id=pack&id2=([0-9]+)$
RewriteRule ^$ /soundpack.php [R]
Is a lot closer but still not close enough I'm afraid.  You can't match a query string question mark by using \? it treats it as a literal question mark in the file name.

You could just redirect using php could you not?
09-06-2006 11:15 AM
Profile E-Mail PM 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 alexp2_ad
code:
RewriteCond %{QUERY_STRING} ^id=pack&id2=([0-9]+)$
RewriteRule ^$ /soundpack.php [R]
Is a lot closer but still not close enough I'm afraid.  You can't match a query string question mark by using \? it treats it as a literal question mark in the file name.

You could just redirect using php could you not?
oh ok, thanks for the help :)   

I could just do it using php yea, but mod_rewrite would have been my preferred method as the index.php is now the MyBB portal page, meaning I'd have to update it everytime I update MyBB.
SoundPacks   -   Scripts   -   Skins

that's not a bug, thats an unexpected feature
09-06-2006 11:19 AM
Profile E-Mail PM Web Find Quote Report
alexp2_ad
Scripting Contest Winner
****

Avatar
Who love the chocolate?

Posts: 691
Reputation: 26
36 / Male / –
Joined: May 2004
Status: Away
RE: RE: Mod_Rewrite Help
quote:
Originally posted by Dempsey
quote:
Originally posted by alexp2_ad
code:
RewriteCond %{QUERY_STRING} ^id=pack&id2=([0-9]+)$
RewriteRule ^$ /soundpack.php [R]
Is a lot closer but still not close enough I'm afraid.  You can't match a query string question mark by using \? it treats it as a literal question mark in the file name.

You could just redirect using php could you not?
oh ok, thanks for the help :)   

I could just do it using php yea, but mod_rewrite would have been my preferred method as the index.php is now the MyBB portal page, meaning I'd have to update it everytime I update MyBB.

Well, at least with that one I gave you you could redirect using the php in soundpack.php ;)

But I'll see if I can dig up something better, it must be possible. *-)


EDIT:  I got it! :D

code:
RewriteCond %{QUERY_STRING} ^id=pack&id2=([0-9]+)$
RewriteRule ^$ /soundpack.php?id=%1 [R,NE]

This post was edited on 09-06-2006 at 11:32 AM by alexp2_ad.
09-06-2006 11:24 AM
Profile E-Mail PM 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 alexp2_ad

EDIT:  I got it! :D

code:
RewriteCond %{QUERY_STRING} ^id=pack&id2=([0-9]+)$
RewriteRule ^$ /soundpack.php?id=%1 [R,NE]

Thanks thats great :D  Does just the job :)
SoundPacks   -   Scripts   -   Skins

that's not a bug, thats an unexpected feature
09-06-2006 11:36 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