简体   繁体   English

在Symfony 1.4项目中更改域时出错

[英]Error when change domain in Symfony 1.4 project

looking from some master on this. 从一些主人那里寻找。

I have my symfony 1.4 project in one domain working perfectly, now I changed the project as it is to another domain ( the same but finishing in .net instead of .com ). 我的symfony 1.4项目在一个域中运行良好,现在我将项目更改为另一个域(相同,但在.net而不是.com中完成)。 Now the home works but all other pages or link destinations to the same page show error "page not found". 现在主页可以使用,但是所有其他页面或指向同一页面的链接目标都显示错误“找不到页面”。 Weird is that when I use the extension frontend.php or index.php before the routing it works fine. 奇怪的是,当我在路由之前使用扩展名frontend.php或index.php时,它可以正常工作。 ( in dev mode all works... ). (在开发人员模式下,所有方法都有效...)。

Of course I cleared the cache lots of times... 当然,我多次清除了缓存...

Any idea? 任何想法? Why changing domain the routing stopped working? 为什么更改域的路由停止工作?

I also changed all htaccess extensions in the new project... 我还更改了新项目中的所有htaccess扩展...

Thanks! 谢谢!

You need mod_rewrite enabled on your web server and your .htaccess file should look like this: 您需要在Web服务器上启用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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM