too long

I want to prevent general access to my css files so I want to know if there is a way to redirect the browser if the user tries to access /graphics/style/*.css using .htaccess since one can't put a redirect rule in a css file?? the css file would be written on page load, and deleted on session end but i need to prevent the css file from being viewed during a session.

Is it possible to do allow access only from server??

In your .htaccess file and add this line:

Deny from  all

if you are planning to restrict to the complete folder create a htaccess in that folder and update above line, and it won't be accessible.

For redirect you can use:

 Redirect /folder/ 404.html

Edit: you can allow only server access the content by allowing the server ip to access the content and deny from others:

 order deny,allow
 deny from all
 allow from 111.222.333.444

Refer:

Deny all, allow only one IP through htaccess

deny direct access to a folder and file by htaccess

Deny access to one specific folder in .htaccess