xampp (home)page not found frontend

Hello fellow cscarters,



I am experiencing some problems with a local cscart installation. The backend is working fine, the frontend however always (home and other pages) returns a 404 page not found.



OS: Windows 7

XAMPP: 1.7.7

Installation path: C:\xampp\htdocs\domainname



htaccess:

RewriteBase /domainname



config.local.php:

$config['http_host'] = 'localhost';

$config['http_path'] = '/domainname';



$config['customer_index'] = 'index.php';



The htaccess file seems to be read by server. Performed to “store_closed” test (store_closed.html is the only page that is displayed on localhost). The mod_rewrite module is also loaded. Any suggestions are welcome.



Thanks in advance.

Comment the RewriteBase and/or remove domainname and see if that works for you.

[quote name='The Tool' timestamp='1370514586' post='163118']

Comment the RewriteBase and/or remove domainname and see if that works for you.

[/quote]



Forgot to mention in OP already tried with RewriteBase commented. RewriteBase without domainname did not solve the problem.

I've never messed with installing on PC. Try different things with the host and path. The host is what you use in the browser to get to the page and the path is the folder where it is located.

[quote name='The Tool' timestamp='1370527767' post='163127']

I've never messed with installing on PC. Try different things with the host and path. The host is what you use in the browser to get to the page and the path is the folder where it is located.

[/quote]



I tried several settings, all with the same results so far. The host settings must be oke, since the backend is working correctly. I also had the feeling this is no rocket science, that why it is soooo frustrating I cannot get the frontend to open correctly.

For my XAMPP my htaccess looks like:


```php



RewriteEngine on

Pleas note that RewriteBase setting is obsolete use it only in case you experience some problems with SEO addon.

Some hostings require RewriteBase to be uncommented

Example:

Your store url is http://www.yourcompany.com/store/cart

So “RewriteBase” should be:

RewriteBase /store/cart

RewriteBase /

RewriteCond %{REQUEST_FILENAME} !.(png|gif|ico|swf|jpe?g|js|css)$

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . index.php?sef_rewrite=1 [L,QSA]



```



Also, make sure you have the rewrite_module active in your Apache settings.

[quote name='Triplets' timestamp='1370560054' post='163158']

For my XAMPP my htaccess looks like:


```php



RewriteEngine on

Pleas note that RewriteBase setting is obsolete use it only in case you experience some problems with SEO addon.

Some hostings require RewriteBase to be uncommented

Example:

Your store url is http://www.yourcompany.com/store/cart

So “RewriteBase” should be:

RewriteBase /store/cart

RewriteBase /

RewriteCond %{REQUEST_FILENAME} !.(png|gif|ico|swf|jpe?g|js|css)$

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . index.php?sef_rewrite=1 [L,QSA]



```



Also, make sure you have the rewrite_module active in your Apache settings.

[/quote]



That is de default htaccess after installation and rewrite_module is loaded. Also no result.

Did some more investigation and the problem doesn't seem related to host and/or path. It seems the index.tpl cannot be found or loaded. Additional information: I use CS-Cart Ultimate 3.0.6



Added some logging in index.php and fn_dispatch() in fn.control.php. In fn_dispatch() the following if statement is not executed:



$view = & Registry::get('view');
if ($view->template_exists('views/' . CONTROLLER . '/' . $tpl)) { // try to find template in base views
$view->assign('content_tpl', 'views/' . CONTROLLER . '/' . $tpl);
} elseif (defined('LOADED_ADDON_PATH') && $view->template_exists('addons/' . LOADED_ADDON_PATH . '/views/' . CONTROLLER . '/' . $tpl)) { // try to find template in addon views
$view->assign('content_tpl', 'addons/' . LOADED_ADDON_PATH . '/views/' . CONTROLLER . '/' . $tpl);
} elseif (!empty($addons)) { // try to find template in addon views that extend base views
foreach ($addons as $addon => $_v) {
if ($view->template_exists('addons/' . $addon . '/views/' . CONTROLLER . '/' . $tpl)) {
$view->assign('content_tpl', 'addons/' . $addon . '/views/' . CONTROLLER . '/' . $tpl);
break;
}
}
}


And later on in this function the status is set to CONTROLLER_STATUS_NO_PAGE



if (!$view->get_var('content_tpl') && $status == CONTROLLER_STATUS_OK) { // FIXME
$status = CONTROLLER_STATUS_NO_PAGE;
}




Not quit sure what to make of all this. Hope some seasoned cs cart users can shed some light on this matter.

Finally figured out what the problem was. In the stores configuration I matched the URL to match the actual domainname, example.com. This should be localhost/example ofcourse.



Hopefully someone can learn from this mistake.