【问题标题】:Error when change domain in Symfony 1.4 project在 Symfony 1.4 项目中更改域时出错
【发布时间】:2017-09-21 23:23:41
【问题描述】:

从一些大师那里寻找。

我的 symfony 1.4 项目在一个域中运行良好,现在我将项目原样更改为另一个域(相同但在 .net 而不是 .com 中完成)。现在主页可以工作,但所有其他页面或指向同一页面的链接目的地都显示错误“找不到页面”。奇怪的是,当我在路由之前使用扩展 frontend.php 或 index.php 时,它工作正常。 (在开发模式下一切正常......)。

当然我清除了很多次缓存...

有什么想法吗?为什么更改域路由停止工作?

我还更改了新项目中的所有 htaccess 扩展...

谢谢!

【问题讨论】:

  • 声音链接 RewriteRules 缺失。检查服务器配置。

标签: php symfony1 symfony-1.4


【解决方案1】:

您需要在您的网络服务器上启用 mod_rewrite,并且您的 .htaccess 文件应如下所示:

Options +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>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-04
    • 1970-01-01
    • 1970-01-01
    • 2013-02-26
    • 1970-01-01
    • 2016-11-29
    相关资源
    最近更新 更多