masking file extensions with php

Status
Not open for further replies.

megler

New member
Aug 14, 2006
85
3
0
Hello all,

Is there a way to use php to mask a file extension? For instance, if I wanted to have .jpg's on a site but didn't want the search engines to see them - could I have a script that would "rename" the jpg to something else?
It wouldn't REALLY rename it, of course, but to the bot it would...

Why would I want this? Adsense comes to mind - to get around the terms of service for pics near ads. I suppose you could do other BH shit with it, but that's actually why I would use it.

Thanks guys,

Marceia

Here's a hottie for your trouble:

125.jpeg
 


Sure, but renaming the file wouldn't do much as I'm sure the bots will look at content-type. Content-Type fields in MIME

It's called "cloaking", and it's fairly basic and fairly common. It's also a good way to get kicked out of AdSense.
 
I know how to cloak a link, I just never gave it a thought as a method for file extensions. Now that I'm thinking about it, yes it does make sense. Thanks for the link - I learned something.
 
Changing the file extension won't save you, but dynamically adding those images via JavaScript is worth a shot.
 
Just a thought - and mind you it's Memorial day so I've been drinking for about 7 hours while barbequeing.

Since you don't want them indexed I'm assuming you have some kind of page that links off....some javascript calling a php script that sets a session value BEFORE going to the page with the images. If the session isn't set - no images.

Not sure if it would still work - read that "G" is working on crawling javascript..... hell not even sure if it's possible since I don't do much with javascript to begin with.
 
As long as your images are in the same folder, you can use a .htaccess rewrite rule to do the trick.

Lots of tutorials out there: Google

Mubs
 
thanks stanley, I'll give a try.

Ed - G is working on crawling javascript? fuck. does G actually listen to the robot.txt instructions? can that keep them away from the script?

thanks guys - good ideas!
 
1st thing that came to mind when reading this was to css the images in the background of the table or div. Then the names will not show up in your code.

Not sure of the search engines indexing, so use at your own risk.

My first post by the way. been doing a lot of reading. Lot of funny fuckers here at WF.

back to reading for me.

GL
 
Status
Not open for further replies.