phpBB SEO
Boards
Directory  
SEO  
Downloads
  phpBB SEO : Search Engine Optimization, Directory, Forums  
Index
Forums
Annuaire
Référencement
Télécharger
 
  Search Rechercher
    Register
Username :  Password :  Log me on automatically each visit  
S'enregistrer  
 
   
How do I block access to my CSS?

 
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » Apache mod Rewrite
::  
Author Message
Brandon



Joined: 09 Jan 2007
Posts: 8

How do I block access to my CSS?Posted: Sun Jan 28, 2007 12:45 am    Post subject: How do I block access to my CSS?

Hey,

I have been trying to block access to my CSS, JS and PHP include(s) files. I have been able to block the PHP files with this code:

Code:
<Files *.php>
order allow,deny
deny from all
</Files>


And the PHP includes still work. I have tried doing the same thing for my CSS, but then no CSS styles are included on the page... Is there anyway to block direct access to my CSS/JS files so that they can't be downloaded, and still keep the pages working?

Thanks, Brandon
Back to top
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 14403

How do I block access to my CSS?Posted: Sun Jan 28, 2007 2:14 am    Post subject: Re: How do I block access to my CSS?

Well the problem is, css style sheet, as well as html, must be publicly reachable to be loaded by a browser.

Includes are server-side, so you do not need to leave the access to all php files.

That's just how it is Wink

_________________
Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche
Back to top
Visit poster's website
Brandon



Joined: 09 Jan 2007
Posts: 8

How do I block access to my CSS?Posted: Sun Jan 28, 2007 2:17 am    Post subject: Re: How do I block access to my CSS?

Sigh... Okay. What about javascript and images, is there anyway to block those?
Back to top
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 14403

How do I block access to my CSS?Posted: Sun Jan 28, 2007 12:39 pm    Post subject: Re: How do I block access to my CSS?

The same.

You can implement some JS to hide JS a bit, and html as well, but, it's not really a protection, since user would see everything all right if they turn JS off.

Anyway, what are you afraid about ?

Internet is mostly public, everybody can access most of the source code, and that's probably why it's growing so fast, because sharing is almost mandatory Wink

++

_________________
Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche
Back to top
Visit poster's website
Brandon



Joined: 09 Jan 2007
Posts: 8

How do I block access to my CSS?Posted: Tue Jan 30, 2007 7:03 pm    Post subject: Re: How do I block access to my CSS?

I guess I will just leave it public...

At it's not that I'm "afraid" of anything, I just like ot keep my sites locked down as tight as possible - For security reasons.

Thanks!
Back to top
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 14403

How do I block access to my CSS?Posted: Tue Jan 30, 2007 7:56 pm    Post subject: Re: How do I block access to my CSS?

You do not take great security risks with css style sheets IMHO, but it's better to think about security like you seem to do.

Locking all php files called through include is for sure a wise thing.
You may as well want to do as phpBB does in addition, define a IN_PHPBB constant in the public files, and check if it was declared in the included ones :
Code:

if ( !defined('IN_PHPBB')  )
{
   die('Hacking attempt');
   exit;
}


I think it's even better to rely on both php, with this check, and Apache, with the .htaccess, to deny access to these files.

++

_________________
Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche
Back to top
Visit poster's website
Peter77
phpBB SEO Team
phpBB SEO Team


Joined: 10 May 2006
Posts: 512
Location: Michigan

How do I block access to my CSS?Posted: Wed Jan 31, 2007 6:12 am    Post subject: Re: How do I block access to my CSS?

Hello, good question. I found this...

Code:
<Files ~ "\.tpl$">
Order allow,deny
Deny from all
Satisfy All
</Files>


Credit
CyberAlien

_________________
Juarol.com
| Frekuenciadigital.com |
Back to top
Display posts from previous:   
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » Apache mod Rewrite
Page 1 of 1

Navigation Similar Topics

Jump to: