Post by filippo.toso » Thu Sep 11, 2008 3:51 am

Hi all,

if you want to correctly run OpenCart under IIS (frontend included) you need 2 small changes.

First open the config.php and admin/config.php files and add the following code:

Code: Select all

define('REWRITE_URLS', false);
Then open the library/environment/url.php file and edit the create() method from this:

Code: Select all

//remastered URLs out
if (!preg_match('/\/admin\/index.php/',$_SERVER['PHP_SELF'])) { // not admin area
	$link=str_replace('controller=','',$link);
	$link=str_replace('&','/',$link);
	$link=str_replace('=','/',$link);
	$link=str_replace('index.php?','',$link);
}
into this:

Code: Select all

//remastered URLs out
if (REWRITE_URLS && !preg_match('/\/admin\/index.php/',$_SERVER['PHP_SELF'])) { // not admin area
	$link=str_replace('controller=','',$link);
	$link=str_replace('&','/',$link);
	$link=str_replace('=','/',$link);
	$link=str_replace('index.php?','',$link);
}
In this way the frontend URLs will work correctly also under IIS.

If you want to move the OpenCart installation under an Apache web server, you can set the new REWRITE_URLS constant in the config.php file to true and get the original behavior.

Hope it helps.
Last edited by filippo.toso on Thu Sep 11, 2008 4:11 am, edited 1 time in total.

Newbie

Posts

Joined
Thu Sep 11, 2008 3:42 am
Who is online

Users browsing this forum: No registered users and 1 guest