Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: [SOLVED] css problem +hiding snews subdir from links  (Read 4085 times)

ha100

  • Newbie
  • *
  • Karma: 7
  • Posts: 19
    • ha100
[SOLVED] css problem +hiding snews subdir from links
« on: October 26, 2008, 12:08:28 am »

all right, so i have some questions.

what i did:
put snews files in http;//localhost/blah_blah/ and make the engine and apache work together to fool user, so he see link like http;//localhost/

if .htaccess file has this extra code
Code: [Select]
RewriteBase /blah_blah

RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^.*$ /blah_blah/$1 [L]

and in snews.php [ver 1.7RC] function site() returns this value
Code: [Select]
//SITE - Automatically detects the scripts location.
function site() {
$host = 'http://'.$_SERVER['HTTP_HOST'];
// $directory = dirname($_SERVER['SCRIPT_NAME']);
// $website = $directory == '/' ? $host.'/' : $host.$directory.'/';
return $host.'/';
}

everything works fine, except css.

Q1 - is there any way to fix the css file inclusion ? (if i copy css folder to root http;//localhost/css/style.css it works but i don't like it this way)

Q2 - could it be taken as some "basic security solution" ?
« Last Edit: October 26, 2008, 01:44:22 am by ha100 »
Logged

ha100

  • Newbie
  • *
  • Karma: 7
  • Posts: 19
    • ha100
Re: css problem +hiding snews subdir from links
« Reply #1 on: October 26, 2008, 01:43:53 am »

 ;D after 5 hours of googling and trying this code solved the css issue

Code: [Select]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^style.css /blah_blah/css/style.css [L]

html source will show just

Code: [Select]
<link href="style.css" type="text/css" rel="stylesheet">
but i'm still curious about that Q2 and if it is done correctly, because i'm .htaccess lame
Logged

Joost

  • Guest
Re: [SOLVED] css problem +hiding snews subdir from links
« Reply #2 on: October 26, 2008, 03:32:21 am »

Q2 - could it be taken as some "basic security solution" ?

but i'm still curious about that Q2 and if it is done correctly, because i'm .htaccess lame

Hiding files ("Security through obscurity")  is no security solution. To secure: Don't grant access.
Logged