What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Is anyone farmiliar with mod_rewite?

Is anyone farmiliar with mod_rewite?
Author: Message:
Baggins
Full Member
***

Avatar
B000ALFAZO

Posts: 387
Reputation: 13
29 / Male / Flag
Joined: Oct 2006
O.P. Is anyone farmiliar with mod_rewite?

.htaccess
code:
RewriteEngine on
RewriteRule ^/hosted/([^/\.]+)/?$ http://%{HTTP_HOST}/hosting.php?file=$1 [R]


you can see how it works now by going to http://files.1337z.com/hosted/test.htm

you can see how it is supposed to work by going to http://files.1337z.com/hosting.php?file=test.htm

can anybody spot a problem?

thanks in advance.
07-18-2007 12:22 AM
Profile E-Mail PM Web Find Quote Report
WDZ
Former Admin
*****

Avatar

Posts: 7106
Reputation: 107
– / Male / Flag
Joined: Mar 2002
RE: Is anyone farmiliar with mod_rewite?
Try removing the first slash. It won't match in a per-directory context because mod_rewrite automatically strips off the directory prefix for you.

Lots more info at: http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriterule

Also, if you want "test.htm" to be redirected, you'll need to modify the regexp so dot characters are allowed. :p

code:
RewriteRule ^hosted/([^/]+)/?$ http://%{HTTP_HOST}/hosting.php?file=$1 [R]
07-18-2007 01:13 AM
Profile PM Web Find Quote Report
Baggins
Full Member
***

Avatar
B000ALFAZO

Posts: 387
Reputation: 13
29 / Male / Flag
Joined: Oct 2006
O.P. RE: Is anyone farmiliar with mod_rewite?
Thanks for that :>

Works perfect now.
07-18-2007 01:37 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