Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google      Sign In   
  • Create Account

Subscribe to HRA Now!

 



Are you a Google Analytics enthusiast?

Share and download Custom Google Analytics Reports, dashboards and advanced segments--for FREE! 

 



 

 www.CustomReportSharing.com 

From the folks who brought you High Rankings!


Sponsored Content

 

 
 

Photo
- - - - -

How To Protect My Css File?


  • Please log in to reply
18 replies to this topic

#1 CynthiaFL

CynthiaFL

    HR 1

  • Members
  • Pip
  • 3 posts

Posted 03 March 2005 - 03:11 AM

Hi there --

Is there a way to set things up so that if someone tries to type in the URL to my CSS
file in their browser, a 'you do not have permission to access this file' or similar error
message appears?

Thanks,

Cynthia

#2 McFox

McFox

    HR 5

  • Active Members
  • PipPipPipPipPip
  • 332 posts
  • Location:Sunny Scotland; no wait, rainy .. no, snowing, ...ah Sunny again.

Posted 03 March 2005 - 03:24 AM

Not really since every browser which uses the css has to be able to call the file.

#3 Renagade Master

Renagade Master

    HR 4

  • Active Members
  • PipPipPipPip
  • 137 posts
  • Location:London, UK

Posted 03 March 2005 - 04:13 AM

When someone accesses your site, their browser will download the CSS file once, then reuse it to format every page that references it after that. This is one advantage of CSS, by seperating presentation from content (HTML) each html file is smaller, and the presentation stuff is downloaded only once.

Nothing is really safe if it needs displaying on the clients computer, because it needs to be on the clients computer, either on hard disk or in memory, it is somewhere.

#4 leadegroot

leadegroot

    Lea de Groot

  • Active Members
  • PipPipPipPipPip
  • 488 posts
  • Location:Brisbane, Australia

Posted 03 March 2005 - 06:08 AM

I would try the htaccess techniques that are used to protect images similarly - presumably they would work. <rummages in bookmarks> See if any of these make sense to you:
http://www.scriptygo...-with-htaccess/
http://www.andybudd....ieves/index.php
http://jeremy.zawodn...ves/000826.html

(htaccess is a curly thing - sometimes you need to read it written a couple of different ways before it makes sense)
Obviously you would change references to 'jpg' or 'gif' to 'css'

HIH!
Lea

#5 Googlewhacked

Googlewhacked

    Got geek?

  • Active Members
  • PipPipPipPipPip
  • 348 posts
  • Location:Florida: The Plywood State

Posted 03 March 2005 - 10:12 AM

I've actually been discussing this very concept with several of my coworkers who are working to achieve the same thing. The only difference is that we use an IIS 6 / Win2k3 server environment instead of Apache, so mod_rewrite isn't an option. (I'd suggest going to Apache, but I'd either get laughed at or told to start packing my stuff...)

The closest thing I have found which *might* help is this obfuscator tool which allows someone to copy-n-paste in some text / code & convert it to a bit of javascript (which can be stored in a .js file).

#6 Jill

Jill

    High Rankings Advisor

  • Admin
  • 32,319 posts

Posted 03 March 2005 - 11:49 AM

Maybe I'm just thick, but why would anyone want/need to hide their CSS file from people?

[moving this to technology and coding section.]

#7 Raphael

Raphael

    The Limey Cowboy

  • Active Members
  • PipPipPipPipPipPip
  • 722 posts
  • Location:New England

Posted 03 March 2005 - 11:53 AM

Unless you wanted to hide some super-nifty CSS techniques, I can't see why you'd want to hide it, personally.

#8 McFox

McFox

    HR 5

  • Active Members
  • PipPipPipPipPip
  • 332 posts
  • Location:Sunny Scotland; no wait, rainy .. no, snowing, ...ah Sunny again.

Posted 03 March 2005 - 12:01 PM

Sometimes people have put so much effort into coding their css that they want to hide it from people who would copy it, or chunks of it, for their own use.

The problem with trying to block access to it is the conflict that exists. The browser (and therefore the user) MUST be able to read the css file. Blocking access to it would effectively prevent the browser reading it AFAIK.

#9 Googlewhacked

Googlewhacked

    Got geek?

  • Active Members
  • PipPipPipPipPip
  • 348 posts
  • Location:Florida: The Plywood State

Posted 03 March 2005 - 01:26 PM

QUOTE(Jill @ Mar 3 2005, 12:49 PM)
Maybe I'm just thick, but why would anyone want/need to hide their CSS file from people?


You are certainly _not_ thick. Indeed, I wholeheartedly agree that this is pointless and a waste of time / resources / etc. However, the powers that be in my org are concerned that 1) using CSS-only layouts will bump them to the top of the SERPs & 2) that (if #1 is true) that this knowledge & the techniques used to do so must be kept secret. I have tried to convince them that #1 is not the case & that #2 is pointless, however my arguements have fallen on deaf ears.

QUOTE(McFox @ Mar 3 2005, 01:01 PM)
The problem with trying to block access to it is the conflict that exists. The browser (and therefore the user) MUST be able to read the css file. Blocking access to it would effectively prevent the browser reading it AFAIK.


Indeed, this is the main arguement that I used. (The link I posted above was found in a 1/2 hearted attempt to placate the others in the discussion & end the debate.) mf_jumpon.gif

Phil

#10 sweepthelegnate

sweepthelegnate

    HR 6

  • Active Members
  • PipPipPipPipPipPip
  • 903 posts
  • Location:Dallas, Texas

Posted 03 March 2005 - 01:56 PM

pretty pointless exercise...It's kind of like anything you put on the web. If someone wants to take it they will. Stealing sites is a big problem. It happens to sites I have designed all the time - over and over. And it's going to keep happening...I believe more and more sites will be taken as people continue to insist in xhtml / css sites and some designers are faced with losing business.

#11 qwerty

qwerty

    HR 10

  • Moderator
  • 8,292 posts
  • Location:Somerville, MA

Posted 03 March 2005 - 02:09 PM

QUOTE
the powers that be in my org are concerned that 1) using CSS-only layouts will bump them to the top of the SERPs & 2) that (if #1 is true) that this knowledge & the techniques used to do so must be kept secret.

They're dreaming, I'm afraid. I would love it if search engines preferred sites that used valid code and CSS for layout. Think of all the work we'd all have smile.gif But it just isn't true. I've seen absolutely no evidence to support it

As far as I can tell, spiders will go through a document and grab what they need to grab, ignoring everything else. The only advantage a CSS layout gives you in that sense is that if you've coded so badly and sloppily that your pages are huge, the spiders might not make it through. With CSS, that's a non-issue.

Besides, it just wouldn't be nice if people could hide their style sheets. How would the rest of us learn anything? Surely we can't all be expected to figure everything out on our own.

#12 sweepthelegnate

sweepthelegnate

    HR 6

  • Active Members
  • PipPipPipPipPipPip
  • 903 posts
  • Location:Dallas, Texas

Posted 03 March 2005 - 02:25 PM

QUOTE
How would the rest of us learn anything? Surely we can't all be expected to figure everything out on our own.


true...but learning and stealing are two different things. I've got no problem with anyone learning and being inspired by my design. After all their aren't too manyd designs out there that are truly unique. But I'd say that 90 percent of the people that end up view my css are there to steal it, not learn how I did something. It hacks me off the most when the person that stole it is some big designer who charges their client 10,000 for my design...the designer is too busy making money to bother to ever learn from my css it's just easier to steal it.

QUOTE
The only advantage a CSS layout gives you in that sense is that if you've coded so badly and sloppily that your pages are huge, the spiders might not make it through. With CSS, that's a non-issue.


Another advantage of separating presentation from content is the fact that it helps people with screen readers etc. That way the visitor doesn't hear, "Welcome to our site, we sell spacer image this image for presentation only widgets." lol.gif

#13 qwerty

qwerty

    HR 10

  • Moderator
  • 8,292 posts
  • Location:Somerville, MA

Posted 03 March 2005 - 02:38 PM

I agree with your last point. My point was just that decreased size is the only advantage it gives you in dealing with SE spiders.

#14 Googlewhacked

Googlewhacked

    Got geek?

  • Active Members
  • PipPipPipPipPip
  • 348 posts
  • Location:Florida: The Plywood State

Posted 03 March 2005 - 04:23 PM

Quite right, Querty. This is exactly the arguement that I used. As I said before, "deaf ears"...

*Sigh!*

#15 sweepthelegnate

sweepthelegnate

    HR 6

  • Active Members
  • PipPipPipPipPipPip
  • 903 posts
  • Location:Dallas, Texas

Posted 03 March 2005 - 06:06 PM

QUOTE(Googlewhacked @ Mar 3 2005, 05:23 PM)
Quite right, Querty. This is exactly the arguement that I used. As I said before, "deaf ears"...

*Sigh!*
View Post



that's what I love about big organizations...everyone has an opinion about what should be done with the website...notice how no one gives tips to the guy from the mail room on how to hand out mail... cheers.gif




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users