FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

mod rewrite - danger?

 


Peterssidan
I found some good text about mod rewrite here: http://forum.modrewrite.com/viewforum.php?f=12

It said something about that you could get into a infinite loop if you do wrong and the server will not be so good.
This is my first mod rewrite rule I have done but I have not tested it yet becase I will not kill the server. ok here it is:
Code:
RewriteEngine on
RewriteRule ^index\.php\?[^=]+=([a-z0-9]+)$ /kabe/$1\.htm [L,NC]

I have a folder in public_html with name kabe. inside kabe I use index.php?page=play but play can be other things. so instead of index.php?page=play I want it be kabe/play.htm.
Is there any danger in testing or could I test these kind of script without danger for the server?
MrBlueSky
No 100% garantuee of course, but it looks oke to me. Especially since you use the L-directive, which makes sure no further rewrite rules are applied.
Peterssidan
thanks. after trying I found that I was thinking at the wrong direction. When I wrote the code I thought that I was translating the url for the user but its fro the server that I translate it for witch make sence. this is the code I use now and it seems to work. fun! Very Happy
Code:
RewriteEngine on
RewriteRule ^([a-z]+)$ index\.php\?page=$1 [L,NC]
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.