FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Appache Mod Rewrite





LukeakaDanish
Hi all,

Anybody clever enough to tell how to rewrite the extension of any URL's within a directory eg. xyz.frih.net/xyz.png?attributes to xyz.frih.net/xyz.php?attributes

(possibly /w appache mod rewrite)

Thanks in advance

- Luke
MrBlueSky
LukeakaDanish wrote:
Hi all,

Anybody clever enough to tell how to rewrite the extension of any URL's within a directory eg. xyz.frih.net/xyz.png?attributes to xyz.frih.net/xyz.php?attributes

(possibly /w appache mod rewrite)

Thanks in advance

- Luke


Put

Code:

RewriteEngine on
RewriteRule ^([^\.]*).png(.*)$ $1.php$2


in .htaccess in that directory. It rewrites test.png?yes=1 to test.php?yes=1
LukeakaDanish
Thanks a lot for the fast reply Smile

donating 100 frih$...
MrBlueSky
Thank you! Very Happy

But test it to see if it indeed does what you want Smile
LukeakaDanish
Yea sure...I will as soon as i have time...

edit: yea...works beautifully Wink
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?
url rewrite
mod rewrite - danger?
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.