-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
97 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# ---------------------------------------------------------------------- | ||
# Adds some security for the Apache server configuration for use with | ||
# yii2-app-practical template. | ||
# @author Kartik Visweswaran <[email protected]> | ||
# @see http://demos.krajee.com/app-practical | ||
# ---------------------------------------------------------------------- | ||
|
||
# "-Indexes" will have Apache block users from browsing folders without a default document | ||
# Usually you should leave this activated, because you shouldn't allow everybody to surf through | ||
# every folder on your server (which includes rather private places like CMS system folders). | ||
<IfModule mod_autoindex.c> | ||
Options -Indexes | ||
</IfModule> | ||
|
||
|
||
# Block access to "hidden" directories whose names begin with a period. This | ||
# includes directories used by version control systems such as Subversion or Git. | ||
<IfModule mod_rewrite.c> | ||
RewriteCond %{SCRIPT_FILENAME} -d | ||
RewriteCond %{SCRIPT_FILENAME} -f | ||
RewriteRule "(^|/)\." - [F] | ||
</IfModule> | ||
|
||
|
||
# Block access to backup and source files | ||
# This files may be left by some text/html editors and | ||
# pose a great security danger, when someone can access them | ||
<FilesMatch "(\.(bak|config|sql|fla|psd|ini|log|sh|inc|swp|dist)|~)$"> | ||
Order allow,deny | ||
Deny from all | ||
Satisfy All | ||
</FilesMatch> | ||
|
||
# Increase cookie security | ||
<IfModule php5_module> | ||
php_value session.cookie_httponly true | ||
</IfModule> | ||
|
||
# Settings to hide index.php and ensure pretty urls | ||
RewriteEngine on | ||
|
||
# if a directory or a file exists, use it directly | ||
RewriteCond %{REQUEST_FILENAME} !-f | ||
RewriteCond %{REQUEST_FILENAME} !-d | ||
|
||
# otherwise forward it to index.php | ||
RewriteRule . index.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# ---------------------------------------------------------------------- | ||
# Adds some security for the Apache server configuration for use with | ||
# yii2-app-practical template. | ||
# @author Kartik Visweswaran <[email protected]> | ||
# @see http://demos.krajee.com/app-practical | ||
# ---------------------------------------------------------------------- | ||
|
||
# "-Indexes" will have Apache block users from browsing folders without a default document | ||
# Usually you should leave this activated, because you shouldn't allow everybody to surf through | ||
# every folder on your server (which includes rather private places like CMS system folders). | ||
<IfModule mod_autoindex.c> | ||
Options -Indexes | ||
</IfModule> | ||
|
||
|
||
# Block access to "hidden" directories whose names begin with a period. This | ||
# includes directories used by version control systems such as Subversion or Git. | ||
<IfModule mod_rewrite.c> | ||
RewriteCond %{SCRIPT_FILENAME} -d | ||
RewriteCond %{SCRIPT_FILENAME} -f | ||
RewriteRule "(^|/)\." - [F] | ||
</IfModule> | ||
|
||
|
||
# Block access to backup and source files | ||
# This files may be left by some text/html editors and | ||
# pose a great security danger, when someone can access them | ||
<FilesMatch "(\.(bak|config|sql|fla|psd|ini|log|sh|inc|swp|dist)|~)$"> | ||
Order allow,deny | ||
Deny from all | ||
Satisfy All | ||
</FilesMatch> | ||
|
||
# Increase cookie security | ||
<IfModule php5_module> | ||
php_value session.cookie_httponly true | ||
</IfModule> | ||
|
||
# Settings to hide index.php and ensure pretty urls | ||
RewriteEngine on | ||
|
||
# if a directory or a file exists, use it directly | ||
RewriteCond %{REQUEST_FILENAME} !-f | ||
RewriteCond %{REQUEST_FILENAME} !-d | ||
|
||
# otherwise forward it to index.php | ||
RewriteRule . index.php |