Symfony 1.4 Routing-Problem
-
25-09-2019 - |
Frage
Ich habe symfony 1.4-Anwendung. Auf Windows-AMP ist alles in Ordnung. Aber auf Linux Apache2 Ich habe eine isseu:
Zum Beispiel i-Anwendung auf myhost bereitgestellt haben.
http: // myhost / - richtig funktioniert, aber http:. // myhost / Modul - nicht funktioniert
Aber in i frontend_dev.php verwenden -. Alles ist richtig
http:. //Myhost/frontend_dev.php/module/ - Werke
Cache ist sauber. Und unter Windows AMP -. Alles richtig
A haben keine Änderungen von .htaccess und in originellen Rahmen in Apache.
hinzugefügt:
Ich habe die folgende Konfiguration von .htaccess
Optionen + FollowSymLinks + ExecCGI
<IfModule mod_rewrite.c>
RewriteEngine On
# uncomment the following line, if you are having trouble
# getting no_script_name to work
RewriteBase /
# we skip all files with .something
#RewriteCond %{REQUEST_URI} \..+$
#RewriteCond %{REQUEST_URI} !\.html$
#RewriteRule .* - [L]
# we check if the .html version is here (caching)
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
# no, so we redirect to our front web controller
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
Lösung
Wenn es wie url/index.php/module
funktioniert, dann müssen Sie mod_rewrite
für vhost ermöglichen.
Andere Tipps
Wie Maerlyn hat erklärt, dieses Problem ist in der Regel aufgrund der Tatsache, dass Sie nicht über mod_rewrite aktiviert ist.
Der einfachste Weg, mod_rewrite zu ermöglichen, ist es, die folgenden Zeilen in der .htaccess-Datei hinzuzufügen:
Options +FollowSymLinks
RewriteEngine On
Das sollte Ihre Routing-Probleme beheben.