我已将opencart中的配置文件从http://mywebsite.in/更改为http://www.mywebsite.in/ .
现在的问题是,当我访问mywebsite.in时,该网站无法正常工作 . 我如何重定向到www或http .
我需要在library / url.php中做一些事情吗?
公共功能链接($ route,$ args ='',$ secure = false){if($ this-> ssl && $ secure){$ url ='https://' . $ _SERVER ['HTTP_HOST'] . rtrim(dirname($ _ SERVER ['SCRIPT_NAME']),'/ . ') . '/index.php?route=' . $路线; } else {$ url ='http://' . $ _SERVER ['HTTP_HOST'] . rtrim(dirname($ _ SERVER ['SCRIPT_NAME']),'/ . ') . '/index.php?route=' . $路线; }
if ($args) {
if (is_array($args)) {
$url .= '&' . http_build_query($args);
} else {
$url .= str_replace('&', '&', '&' . ltrim($args, '&'));
}
}
请帮我 . 非常感谢提前 .
1 回答
Aditya,您需要在根文件夹中创建.htaccess文件,然后对该文件进行以下更改 .
它会强行重定向到www . 如果它的工作然后给我whote .