Welcome Guest, Not a member yet? Register   Sign In
Alarm! can't access /user_guide/ folder locally
#1

[eluser]Flying Fish[/eluser]
Hi folks. Brand spanking newbie here fresh from ye olde video tuts.

Getting a 404 when I try to access http://staging2:8888/user_guide/ in which staging2 is my local development server.

I'm using .htacess to remove index.php from my urls, could this be the problem?

Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

Other question, is it possible to create custom .htaccess rules to traffic from a browser to the system folder as an added security measure, or is there no need really?

Thanks in advance.
#2

[eluser]Jelmer[/eluser]
The .htaccess is indeed probably the problem. It will rewrite any URI to CodeIgniter except for the exceptions set in the rule:
Code:
RewriteCond $1 !^(index\.php|images|robots\.txt)

In order to allow access to your user_guide directory you have to add it to your exceptions:
Code:
RewriteCond $1 !^(index\.php|images|user_guide|robots\.txt)
This rule will excempt URI's which access the index.php or robots.txt files directly, and the directories images & user_guide are excempted completely.

This rule should already prevent direct access to the system directory because any URI with /system/ in it is not excempt from rewriting by the rule above.

Another way to prevent direct access to your system & application directories is by putting them outside the webroot (if you're allowed) and changing the $system_folder and $application_folder variables to point to the correct locations.
#3

[eluser]pistolPete[/eluser]
There is no need to access the user guide through a (local) server.
Just copy it somewhere on the harddrive and open up the index.html.

Your .htaccess file does not check if a folder/file actually exists. You need something like:
Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

Didn't really get your second question, are you trying to restrict direct access to the system directory?

You normally put this on top of every php file:
Code:
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
This prevents direct script access.

But you can put another .htaccess file in the system folder with just the following contents:
Code:
DENY FROM ALL
#4

[eluser]Flying Fish[/eluser]
Wow. Thanks for the fast response guys.

Will most likely need some more help soon. :-)




Theme © iAndrew 2016 - Forum software by © MyBB