How to remove index.php from URL (#645) + set a config rule to be strict with sessions matching IP

This commit is contained in:
FrancescoUK
2016-06-13 17:54:31 +01:00
parent cd6277c1a8
commit 9dc7405eaa
2 changed files with 25 additions and 14 deletions

View File

@@ -1,14 +1,25 @@
RewriteEngine On
# Option 2: To rewrite "domain.com -> www.domain.com" uncomment the following lines.
# To redirect a subdomain to a subdir because of https not supporting wildcards
# replace values between <> with your ones
# RewriteCond %{HTTP_HOST} ^<OSPOS subdomain>\.<my web domain>\.com$ [OR]
# RewriteCond %{HTTP_HOST} ^www\.<OSPOS subdomain>\.<my web domain>\.com$
# RewriteRule ^/?$ "https\:\/\/www\.<my web domain>\.com\/<OSPOS path>" [R=301,L]
# To rewrite "domain.com -> www.domain.com" uncomment the following lines.
# RewriteCond %{HTTPS} !=on
# RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
# RewriteCond %{HTTP_HOST} (.+)$ [NC]
# RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]
# Suppress index.php from OSPOS URL
# Remember to set in application/config/config.php $config['index_page'] = '';
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# if in web root
RewriteRule ^(.*)$ index.php?/$1 [L]
# if in subdir comment above line, uncomment below one and replace <OSPOS path> with your path
# RewriteRule ^(.*)$ /<OSPOS path>/index.php?/$1 [L]
# disable directory browsing
# For security reasons, Option all cannot be overridden.
@@ -20,22 +31,22 @@ IndexIgnore *
# secure htaccess file
<Files .htaccess>
order allow,deny
deny from all
order allow,deny
deny from all
</Files>
# prevent access to PHP error log
<Files error_log>
order allow,deny
deny from all
satisfy All
order allow,deny
deny from all
satisfy All
</Files>
# prevent access to generate_languages.php
<Files generate_languages.php>
order deny,allow
deny from all
allow from 127.0.0.1
order deny,allow
deny from all
allow from 127.0.0.1
# My IP(s)
# allow from xxx.xxx.xxx.xxx
@@ -43,8 +54,8 @@ IndexIgnore *
</Files>
<IfModule mod_expires.c>
<FilesMatch "\.(jpe?g|png|gif|js|css)$">
ExpiresActive On
ExpiresDefault "access plus 1 week"
</FilesMatch>
<FilesMatch "\.(jpe?g|png|gif|js|css)$">
ExpiresActive On
ExpiresDefault "access plus 1 week"
</FilesMatch>
</IfModule>

View File

@@ -384,7 +384,7 @@ $config['sess_driver'] = 'database';
$config['sess_cookie_name'] = 'ospos_session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = 'sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_match_ip'] = TRUE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;