PDA

View Full Version : protect external css from being downloaded


fred
11-06-2002, 03:54 AM
hi guys, let say if i have an external .css or .js, how can i protect them from being downloaded by the visitors (eg. by typing http://www.mydomain.com/css/style.css) using .htaccess??

MikeParent
11-06-2002, 04:13 AM
Erm,
A) I Doubt that you could... I dont think the web server makes a distinction between a user specifically requesting the document or the user requesting a page that includes the document.

B) Why on earth would you care about protecting CSS or Javascript from being downloaded?

fred
11-06-2002, 04:32 AM
actually i saw something like this b4....

well, because i used to use css to do most of my SEO 'tricks', so i hope not every visitor or my competitors get to know what have i done. Although they will still have a way to get it, i just dont want to make their live so easy :D

Zero Angel
11-06-2002, 12:08 PM
Hiding code is selfesh. Also, 90% percent of the websites that i've seen with security measures protecting their code are mediocre personal websites.

As far as trying to hide CSS or JS documents....they get cached anyways. If I wanted to look at your files, all I have to do is navigate to 'temporary internet files'.

fred
11-08-2002, 01:43 AM
yup i know that, but just dont want anyone can get it so easily...... is for some tricks in SEO, so wont want competitor to know also.... unless they are a hardcore developer, then it cant be helped.

Flogg
11-11-2002, 11:16 PM
The only way that you can hide your source is to not put it on the web! Yep that easy, though I don't think it's the best idea.

BoR|S
11-12-2002, 05:11 AM
I'm not sure if this can work, but:

Since the html file which is calling to the css file is located on the same (local) server as the css file, then you should configure the /css/ directory to be acceable only localy...

-TheDarkEye-
11-12-2002, 09:13 PM
he might as well not even put it on the web if he does that bor|s.

DCElliott
11-13-2002, 03:02 AM
Thats right, BoR|S, the server has to "serve" that page. You can just substitute the path to the *.CSS file in the address line and up comes the CSS.

BoR|S
11-13-2002, 04:07 AM
Hmmmm okey... Didn't think about that... :rolleyes:
+
-TheDarkEye-: please write my nickname as "BoR|S" :D