FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free 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]
Related topics
Sirius Black's
htaccess
mod_rewrite
mod_rewrite in Apache and how does it work?
.htaccess instead of mod_rewrite
[PHP] Calling dynamic pictures
How do you do this?
Mod Rewrite!!
How to use mod rewrite?
Does mod rewrite nescessary?
Appache Mod Rewrite
url rewrite
Help needed with mod rewrite
Mod rewrite subdomain
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

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