簡體   English   中英

Symfony 1.4路由問題

[英]Symfony 1.4 routing issue

我有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和Apache中的settins都沒有任何更改。

添加:

我有以下.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

正如Maerlyn所說,此問題通常是由於您沒有啟用mod_rewrite而導致的。

啟用mod_rewrite的最簡單方法是在.htaccess文件中添加以下行:

Options +FollowSymLinks
RewriteEngine On

那應該解決您的路由問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM