Welcome Guest, Not a member yet? Register   Sign In
Super .htaccess file
#31

[eluser]BaRzO[/eluser]
off course you can split folder like that Wink
#32

[eluser]Xeoncross[/eluser]
I don't think it is good to split up a system into more than two directories (CI system and your appplication) because they both are different. You should never touch the system dir so you can just keep it setup on SVN updates. But the app directory could be moved around to any CI install without any trouble.

Anyway, with Apache setup right - I don't know why people are so worried about having PHP files in the open - no one can get to them - we don't even need "index.html" or "if(!defined)" checks.
#33

[eluser]Xeoncross[/eluser]
I was just going over this file when I realized that it can be improved.


Code:
# If the file is NOT the index.php file
RewriteCond %{REQUEST_FILENAME} !index.php
# Hide all PHP files so none can be accessed by HTTP
RewriteRule (.*)\.php$ index.php?/$1

# If the file/dir is not real
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php?/$1 [QSA,L]

Shouldn't we be able to check to see if it has a PHP extension instead of just point everything to the index.php file?


Code:
# If the file/dir is not real
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# Hide all PHP files so none can be accessed by HTTP
# If they are accessing a PHP file
RewriteCond %{REQUEST_FILENAME}\.php -f

RewriteRule ^(.*)$ index.php?/$1 [QSA,L]

Is this the right way to do it?




Theme © iAndrew 2016 - Forum software by © MyBB