| Coding Forum Problems with your code? Let's hear about it. |
06-04-2004, 03:39 PM
|
#1 (permalink)
|
|
Inactive
Join Date: 06-04-04
Posts: 5
Latest Blog: None
|
htaccess - require part filename
Hi, what i'm doing, is writting a modification for Invision Power Board, that watermarks all images. The downside of this is it is easily by-passable because IPB does not do that great of job with hiding file names, so what I would like to do is use most likely a .htaccess script to require part of the filename.
So if the url to the image was http://www.site.com/forums/uploads/w...=thisimage.jpg
I would like it so that all images in my uploads directory require watermark.php?name= in the filename or it returns an error. Is this possible, and if so how?
Thanks, Nelsobra
|
|
|
06-04-2004, 03:52 PM
|
#2 (permalink)
|
|
Possible Terrorist
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 4,904
|
if the script loads them dynamically then just move them out of your /public_html/ directory..
__________________
Kyle Varga
"m3lt/theSpear"
student, web designer/coder, future IT consultant
Experience: PHP/MySQL, Java, C++, MS-SQL
|
|
|
06-04-2004, 03:56 PM
|
#3 (permalink)
|
|
Inactive
Join Date: 06-04-04
Posts: 5
Latest Blog: None
|
no good
I think you misunderstood what I'm trying to do.
I've made it so that all images uploaded to my forum are automatically watermarked, to prevent people from stealing them, also because someone requested I make this mod for them.
BUT the problem with it is that it shows the image name at the end of the php statement, so all someone has to do is remove the watermark.php?name= bit and they can view the image without the watermark. So I want preferably a .htaccess script that requires the watermark.php.... bit on all jpg and png filenames in that directory or it won't work.
|
|
|
06-04-2004, 04:14 PM
|
#4 (permalink)
|
|
Possible Terrorist
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 4,904
|
what i would do..
change the upload to upload to like /uploads/ instead of /public_html/uploads/ and then make the thumbnail script look in /uploads/ instead too..
__________________
Kyle Varga
"m3lt/theSpear"
student, web designer/coder, future IT consultant
Experience: PHP/MySQL, Java, C++, MS-SQL
|
|
|
06-04-2004, 04:30 PM
|
#5 (permalink)
|
|
Inactive
Join Date: 06-04-04
Posts: 5
Latest Blog: None
|
no public_html
It's not in public html. And even if it was, this doesn't solve the problem. A person can easily remove the php part, and see the original unwatermarked image.
I really don't think you understand what I'm trying to do.
|
|
|
06-04-2004, 04:32 PM
|
#6 (permalink)
|
|
Possible Terrorist
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 4,904
|
yes i do.. you want ppl to have to go through your script to view the images..
for someone to view the images without a script the pics must be in some folder after public_html/
if you moved then to somewhere outside of public_html/ a script on your server would be necessary for someone to view the pics.. thus, your watermarking php script
__________________
Kyle Varga
"m3lt/theSpear"
student, web designer/coder, future IT consultant
Experience: PHP/MySQL, Java, C++, MS-SQL
|
|
|
06-04-2004, 04:40 PM
|
#7 (permalink)
|
|
Inactive
Join Date: 06-04-04
Posts: 5
Latest Blog: None
|
ok
Is there anyway to do this keeping the default forum structure. I don't want to have to move my upload folder around, because that would mean I would have to modify my sql database, and correct all the file locations.
|
|
|
06-04-2004, 07:11 PM
|
#8 (permalink)
|
|
Inactive
Join Date: 06-03-04
Posts: 24
Latest Blog: None
|
change your image locatinos to the php script, and have it call the image name from above the public directory.. thats really al l you have to do
|
|
|
06-04-2004, 08:14 PM
|
#9 (permalink)
|
|
Inactive
Join Date: 06-04-04
Posts: 5
Latest Blog: None
|
damn.
This isn't going the way I want it to, so is there any way I can just hash the filename say md5 hash it insert that md5 hash into another column of my ibf_posts table, and then when the url leads to the md5 hash it shows the image shown in the attach_file column which is the real image name...
|
|
|
06-04-2004, 08:16 PM
|
#10 (permalink)
|
|
Possible Terrorist
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 4,904
|
that would be way more complicated then just moving the files off the server..
__________________
Kyle Varga
"m3lt/theSpear"
student, web designer/coder, future IT consultant
Experience: PHP/MySQL, Java, C++, MS-SQL
|
|
|
06-04-2004, 08:56 PM
|
#11 (permalink)
|
|
v7n Mentor
Join Date: 10-11-03
Posts: 1,137
Latest Blog: None
|
RewriteEngine On
RewriteRule ^/forums/uploads/watermark.php\?name=[a-zA-z0-9]\.jpg$ /forums/watermarked/$1
This essentially rewrites the URLs to
www.site.com/forums/watermarked/imagename
This hasn't been tested.. and you would need to rewrite the urls to match that style with watermarked/imagename
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 10:47 AM.
© Copyright 2008 V7 Inc
|