Skip to content

Commit

Permalink
fix rewite for n
Browse files Browse the repository at this point in the history
  • Loading branch information
VINADES.,JSC authored and vuthao committed Aug 24, 2017
1 parent c682b2c commit d1523f0
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions includes/core/admin_functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,10 @@ function nv_version_compare($version1, $version2)
function nv_check_rewrite_file()
{
global $sys_info;

if ($sys_info['supports_rewrite'] == 'rewrite_mode_apache') {
if ($sys_info['supports_rewrite'] == 'nginx') {
return true;
}
elseif ($sys_info['supports_rewrite'] == 'rewrite_mode_apache') {
if (!file_exists(NV_ROOTDIR . '/.htaccess')) {
return false;
}
Expand All @@ -350,8 +352,7 @@ function nv_check_rewrite_file()

return (preg_match('/\#nukeviet\_rewrite\_start(.*)\#nukeviet\_rewrite\_end/s', $htaccess));
}

if ($sys_info['supports_rewrite'] == 'rewrite_mode_iis') {
elseif ($sys_info['supports_rewrite'] == 'rewrite_mode_iis') {
if (!file_exists(NV_ROOTDIR . '/web.config')) {
return false;
}
Expand All @@ -376,7 +377,10 @@ function nv_rewrite_change($array_config_global)
$rewrite_rule = $filename = '';
$endurl = ($array_config_global['rewrite_endurl'] == $array_config_global['rewrite_exturl']) ? nv_preg_quote($array_config_global['rewrite_endurl']) : nv_preg_quote($array_config_global['rewrite_endurl']) . '|' . nv_preg_quote($array_config_global['rewrite_exturl']);

if ($sys_info['supports_rewrite'] == 'rewrite_mode_iis') {
if ($sys_info['supports_rewrite'] == 'nginx') {
return array(true, true);
}
elseif ($sys_info['supports_rewrite'] == 'rewrite_mode_iis') {
$filename = NV_ROOTDIR . '/web.config';
$rulename = 0;
$rewrite_rule .= "\n";
Expand Down

0 comments on commit d1523f0

Please sign in to comment.