Follow us on Twitter!
You cannot teach a man anything; you can only help him find it within himself. - Galileo
Saturday, April 19, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 24
Guests Online: 21
Members Online: 3

Registered Members: 82838
Newest Member: w1zarrd
Latest Articles
View Thread

HellBound Hackers | Computer General | Webmasters Lounge

Author

mod rewrite Perfection


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 26-05-10 11:46
Hi all,

I was wondering if anyone could help me with the following:

Code
RewriteRule ^index.php?l=([0-9].*)&s=([0-9]+)&mod=([a-zA-Z]+)&view=([a-zA-Z]+)&no=([0-9]+) /index/league/$1/season/$2/mod/$3/view/$4/num/$5





I want it to replace
Code
l=2&s=2&mod=user&view=admin&no=1



to something like:
Code
/league/1/season/2/mod/user/view/admin/num/1






Any reason why this wouldn't work?

~RichieC




Edited by on 26-05-10 11:55
Author

RE: mod rewrite Perfection

SySTeM
Member

Your avatar

Posts: 1524
Location: England, UK
Joined: 27.07.05
Rank:
HBH Guru
Posted on 26-05-10 12:35
RewriteEngine On

RewriteRule ^index\/league\/([0-9]+)\/season\/([0-9]+)\/mod\/([a-zA-Z]+)\/view\/([a-zA-Z]+)\/num\/([0-9]+)$ index\.php\?l=$1&s=$2&mod=$3&view=$4&no=$5


img138.imageshack.us/img138/6527/sig2ak1.jpg
www.hellboundhackers.org/sig/r/2783.png

http://www.elites0ft.com/
Author

RE: mod rewrite Perfection


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 26-05-10 12:53
Cheers system_meltdown, but it still doesn't appear to be working. Have you got any idea why that would be?

It still appears to show the query strings.




Author

RE: mod rewrite Perfection

SySTeM
Member

Your avatar

Posts: 1524
Location: England, UK
Joined: 27.07.05
Rank:
HBH Guru
Posted on 26-05-10 14:01
DarkMantis wrote:
Cheers system_meltdown, but it still doesn't appear to be working. Have you got any idea why that would be?

It still appears to show the query strings.



Shows the query strings? How do you mean?


img138.imageshack.us/img138/6527/sig2ak1.jpg
www.hellboundhackers.org/sig/r/2783.png

http://www.elites0ft.com/
Author

RE: mod rewrite Perfection


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 26-05-10 14:13
Well It appears that the URL has not been rewritten at all.

Here is the result of the rewrite after applied:

Code
index.php?l=2&s=3&mod=user&view=admins




And here is the .htaccess file as of now:

RewriteBase /
RewriteEngine On
RewriteRule ^index\/league\/([0-9]+)\/season\/([0-9]+)\/mod\/([a-zA-Z]+)\/view\/([a-zA-Z]+)\/num\/([0-9]+)$ index\.php\?l=$1&s=$2&mod=$3&view=$4&no=$5







Edited by on 26-05-10 14:15
Author

RE: mod rewrite Perfection

SySTeM
Member

Your avatar

Posts: 1524
Location: England, UK
Joined: 27.07.05
Rank:
HBH Guru
Posted on 26-05-10 14:20
Lol... that's not how it works dude. It simply creates a symlink to it, of course you can still access it the main way, but if you try and go to the rewritten url directly via the address bar it should work.


img138.imageshack.us/img138/6527/sig2ak1.jpg
www.hellboundhackers.org/sig/r/2783.png

http://www.elites0ft.com/
Author

RE: mod rewrite Perfection


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 26-05-10 14:24
Ahh right, sorry I obviously got it wrong, So if I rewrite the links literally then it will go directly to the same place?

Sorry, I'm quite new to mod_rewrite and regex.

Thanks.


Author

RE: mod rewrite Perfection

SySTeM
Member

Your avatar

Posts: 1524
Location: England, UK
Joined: 27.07.05
Rank:
HBH Guru
Posted on 26-05-10 14:33
DarkMantis wrote:
So if I rewrite the links literally then it will go directly to the same place?


Should do, yeah Smile


img138.imageshack.us/img138/6527/sig2ak1.jpg
www.hellboundhackers.org/sig/r/2783.png

http://www.elites0ft.com/
Author

RE: mod rewrite Perfection


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 26-05-10 23:22
What did you expected.. lol
Author

RE: mod rewrite Perfection

clone4
Member



Posts: 586
Location: He is back and he's bad!
Joined: 25.11.07
Rank:
Mad User
Posted on 26-05-10 23:41
l337 wrote:
What did you expected.. lol


And the award for the most useless post of the month goes to....... *drum roll*

Oh my god, how unexpected, it is L336!!! *applause*

...lol


[img][/img]img164.imageshack.us/img164/5713/perlvl0.jpg

clone4.freehostia.com/ubuntu_3.png
spyware - "They see me trollin'..."
<yaragn> ever seen that movie? The Matrix?
<yaragn> with those green lines of flying text?
<yaragn> *THAT'S* Perl

clone_4@hotmail.com