.htaccess problém s COOL URL

Upozornění: Tohle vlákno je hodně staré a informace nemusí být platné pro současné Nette.
Pavik
Člen | 5
+
0
-

Dobrý den,
moje stránka je na hostingu http://www.svethostingu.cz/. Checker mi vyhodí, že appka může v klidu fungovat ale je zde problém, že mi to hází 404ky, přitom templaty tam na to jsou. Bude to problém asi s mod_rewrite – viz obrázek. Zkoušel jsem pár návodů co jsem tady našel, ale nic z toho mi nepomohlo.

FTP struktura:

- root
 --rezervace
  ---app
  ---assets
  ---libs
  ---log > práva 777
  ---temp > práva 777
  ---tests
  ---www
  ---composer
  ---checker.php
  ---.htaccess

.htaccess – Options jsou vypnuty, jinak hází error 500:

# Apache configuration file (see httpd.apache.org/docs/2.2/mod/quickreference.html)

# disable directory listing
#Options -Indexes

# enable cool URL
<IfModule mod_rewrite.c>
	RewriteEngine On
	RewriteBase /

	# prevents files starting with dot to be viewed by browser
	RewriteRule /\.|^\. - [F]

	# front controller
	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_FILENAME} !-d
	RewriteRule !\.(pdf|js|ico|gif|jpg|png|css|rar|zip|tar\.gz)$ index.php [L]
</IfModule>

# enable gzip compression
<IfModule mod_deflate.c>
	AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript text/javascript application/javascript application/json
</IfModule>

# allow combined JavaScript & CSS. Inside of script.combined.js you could use <!--#include file="script.js" -->
<IfModule mod_include.c>
	<FilesMatch "\.combined\.(js|css)$">
		# Options +Includes
		SetOutputFilter INCLUDES
	</FilesMatch>
</IfModule>

bootstrap

<?php

/**
 * My Application bootstrap file.
 */
use Nette\Application\Routers\Route;



// Load Nette Framework or autoloader generated by Composer
require LIBS_DIR . '/autoload.php';


// Configure application
$configurator = new Nette\Config\Configurator;
$configurator->setDebugMode(TRUE);
// Enable Nette Debugger for error visualisation & logging
//$configurator->setDebugMode($configurator::AUTO);
$configurator->enableDebugger(__DIR__ . '/../log');

// Enable RobotLoader - this will load all classes automatically
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()
	->addDirectory(APP_DIR)
	->addDirectory(LIBS_DIR)
	->register();

// Create Dependency Injection container from config.neon file
$configurator->addConfig(__DIR__ . '/config/config.neon');
$container = $configurator->createContainer();

// Setup router
$container->router[] = new Route('index.php', 'Homepage:default', Route::ONE_WAY);
$container->router[] = new Route('<presenter>/<action>[/<id>]', 'Homepage:default');


// Configure and run the application!
$container->application->run();

nevíte co s tím? Děkuji

Editoval Pavik (1. 10. 2012 14:39)

Ot@s
Backer | 476
+
0
-

Na tomto hostingu bez podpory mod_rewrite musíš použít SimpleRouter.

Marek Šneberger
Člen | 130
+
0
-

Napsat na hosting, ať ti aktivujou mod_rewrite ;)

Pavik
Člen | 5
+
0
-

Ok, díky za reakce. Zatím nastavím simple router a pokud mi to povolí tak to změním na cool url ;)