View Single Post
Old 12-20-2009, 01:56 PM   #1 (permalink)
ReSpawN
The Frequenter
 
ReSpawN's Avatar
 
Join Date: Nov 2007
Location: Netherlands
Posts: 460
Thanks: 49
ReSpawN is on a distinguished road
Default .htaccess, rewriting url

I've been trying to rewrite my url to do the following.

I've got a file (image) stored in /gallery/media/avatar/n/r/ and the filename respawn.jpg. Through .htaccess, I would like to aproach the URL through this url: http://avatar.domain.tld/n/r/respawn.jpg

The question is, how? My script keeps rewriting the URL. I can aproach it, but the URL changes upon find.

PHP Code:
RewriteCond %{HTTP_HOST}     ^avatar\.domain\.tld$ [NC]
RewriteCond %{REQUEST_URI}     ^/avatar/(.*)/(.*)/(.*) [NC]
RewriteRule (.*) http://www.google.nl/$1/$2 [NC] 
Do not mind the google.nl part, that was just for testing. I feel like I am on the righ track, but I can't seem to get it to work.

I followed some instructions on http://corz.org/serv/tricks/htaccess2.php, perhaps someone can use it.

Looking forward to some responses.

ReSpawN
__________________
"Life is a bitch, take that bitch on a ride"
Send a message via MSN to ReSpawN
ReSpawN is offline  
Reply With Quote