IP Based Mod Re-Write

Discussions about Apache mod Rewrite, .htaccess, Use, experiences ... URL Rewriting.

Moderator: Moderators

IP Based Mod Re-Write

Postby ChuckTSI » Wed Dec 12, 2012 9:05 pm

I have searched hi and low.. and not sure how to word my request to get the information I am looking for. I will try to explain and see if anyone here can help.

Let's assume I have a file: -http://www.ottawaphotos.com/myfile1.jpg

Now.. I never want anyone to see the true path for that file.

What I would like is, once a user logs in to the site, image paths are generated via php using X method (how will depend on how this interacts with Mod_Rewrite). The path would have an encrypted filename using some mix of session id, filename and IP of that user.

Example: User #1: Visits site with her IP of 174.23.56.201
Generated links look like this: -http://www.ottawaphotos.com/7ghdjs27384ks83k23.jpg

When the user clicks, Mod_Rewrite would decrypt the 7ghdjs27384ks83k23 (using her IP) into myfile1 and get the file for the user.

User #2: Visits site with hisIP of 56.78.201.34
Generated links look like this: -http://www.ottawaphotos.com/8974jf9dfja89jaa.jpg

When the user clicks, Mod_Rewrite would decrypt the 8974jf9dfja89jaa (using his IP) into myfile1 and get the file for the user.

In essence, this would allow a user to view/dowload a file, but if he sent the link to his buddy, the link would return 404 for the buddy.
Ignoring the obvious he can mail the file to his buddy or what if we have same ip, etc, I am just curious as to if this can be done. I have seen it on other sites. (vk.com for example)

Not sure if that is clear as mud.

Thanks for any help you can provide.

Cheers!
- Chuck
ChuckTSI
 
Posts: 1
Joined: Wed Dec 12, 2012 8:49 pm

Advertisement

Return to Apache mod Rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 2 guests