قضية التوجيه Symfony 1.4
-
25-09-2019 - |
سؤال
لدي تطبيق Symfony 1.4. على Windows AMP كله صحيح. لكن على Linux Apache2 لدي isseu:
على سبيل المثال ، قمت بنشر تطبيق على MyHost.
http: // myhost/ - يعمل بشكل صحيح ، ولكن http: // myhost/module - لا يعمل.
ولكن في استخدام Frontend_dev.php - كل شيء صحيح.
http: //myhost/frontend_dev.php/module/ - الأعمال.
ذاكرة التخزين المؤقت نظيفة. وعلى Windows AMP - كل شيء صحيح.
لم يكن أي تغييرات في .htaccess وفي المستقر في أباتشي.
إضافة:
لدي التكوين التالي من .htaccess
خيارات +تتبع 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>
المحلول
إذا كان يعمل مثل url/index.php/module
, ، ثم تحتاج إلى تمكين mod_rewrite
ل VHOST الخاص بك.
نصائح أخرى
كما ذكرت Maerlyn ، فإن هذه المشكلة عادة ما تكون بسبب حقيقة أنه لم يتم تمكين mod_rewrite.
أسهل طريقة لتمكين mod_rewrite ، هي إضافة الأسطر التالية في ملف .htaccess الخاص بك:
Options +FollowSymLinks
RewriteEngine On
يجب أن يصلح مشاكل التوجيه الخاصة بك.