Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [Symfony]Uruchamianie app.php po wejściu na stronę
Szymciosek
post
Post #1





Grupa: Zarejestrowani
Postów: 1 168
Pomógł: 126
Dołączył: 5.02.2010
Skąd: Świdnica

Ostrzeżenie: (0%)
-----


Witam
jak zrobić (może to tylko kwestia htaccess, ale wątpię dlatego pytam) aby po wejściu na stronę www.xxx.pl uruchamiał się od razu folder www.xxx.pl/web ?

oczywiście nie chce mieć tego widocznego w url.


Przy zmianie w htaccess (dodaniu) web/app.php otrzymuję błędy:

Kod
No route found for "GET /labs/Symfony/site/"

404 Not Found - NotFoundHttpException
1 linked Exception:
ResourceNotFoundException ?

[2/2] NotFoundHttpException: No route found for "GET /labs/Symfony/site/"  

[1/2] ResourceNotFoundException:    

Logs  

1 error
Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelRequest".
Notified event "kernel.request" to listener "Symfony\Bundle\FrameworkBundle\EventListener\RouterListener::onEarlyKernelRequest".
Notified event "kernel.request" to listener "Symfony\Bundle\FrameworkBundle\EventListener\SessionListener::onKernelRequest".
Notified event "kernel.request" to listener "Symfony\Component\Security\Http\Firewall::onKernelRequest".
Notified event "kernel.request" to listener "Symfony\Bundle\FrameworkBundle\EventListener\RouterListener::onKernelRequest".
Notified event "kernel.exception" to listener "Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelException".
Notified event "kernel.exception" to listener "Symfony\Component\HttpKernel\EventListener\ExceptionListener::onKernelException".
Symfony\Component\HttpKernel\Exception\NotFoundHttpException: No route found for "GET /labs/Symfony/site/" (uncaught exception) at F:\WORK\labs\Symfony\site\vendor\symfony\src\Symfony\Bundle\FrameworkBundle\EventListener\RouterListener.php line 83
Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelRequest".
Notified event "kernel.request" to listener "Symfony\Bundle\FrameworkBundle\EventListener\RouterListener::onEarlyKernelRequest".
Notified event "kernel.request" to listener "Symfony\Bundle\FrameworkBundle\EventListener\SessionListener::onKernelRequest".
Notified event "kernel.request" to listener "Symfony\Component\Security\Http\Firewall::onKernelRequest".
Notified event "kernel.request" to listener "Symfony\Bundle\FrameworkBundle\EventListener\RouterListener::onKernelRequest".
Notified event "kernel.request" to listener "Symfony\Bundle\AsseticBundle\EventListener\RequestListener::onKernelRequest".
Notified event "kernel.controller" to listener "Symfony\Bundle\FrameworkBundle\DataCollector\RequestDataCollector::onKernelController".
Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\ControllerListener::onKernelController".
Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\ParamConverterListener::onKernelController".
Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener::onKernelController".
Notified event "kernel.controller" to listener "JMS\SecurityExtraBundle\Controller\ControllerListener::onCoreController".



Dodam jeszcze, że próbowałem też dodać w głównym katalogu plik index.php, który będzie miał w sobie include ('web/app.php');
lecz nie zdało to egzaminu, po prostu gdzieś ścieżki do zdjęć itd itp pouciekały.

Ten post edytował Szymciosek 10.10.2012, 19:25:35
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
ano
post
Post #2





Grupa: Zarejestrowani
Postów: 435
Pomógł: 40
Dołączył: 16.02.2003
Skąd: Wrocław

Ostrzeżenie: (0%)
-----


Masz trzy opcje:

1. Wystarczy zmienić DocumentRoot:
http://httpd.apache.org/docs/current/mod/c...ml#documentroot

2. Zmiana w .htaccessie typu:
Kod
RewriteEngine on
RewriteRule ^/$ /web/

(http://httpd.apache.org/docs/2.0/misc/rewriteguide.html)

3. Jeśli nie mozesz zmienić ani DocumentRoota ani dodać reguły do htaccessa to zamiast w web, przechowuj pliki publiczne w public_html (standardowy na jakichśtam hostingach wirtualnych etc.)
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 15.10.2025 - 08:52