开发者

symfony routing problems with index.php

开发者 https://www.devze.com 2022-12-10 02:18 出处:网络
I have a site built in symfony. However, I\'m putting some routing rules : resgister: url:/register param:{ module: register, action: index }

I have a site built in symfony.

However, I'm putting some routing rules :

resgister:
url:     /register
param:   { module: register, action: index }

and I put a link :

link_to('register - here','register')

but this link points to http://www.mydomain.com/register instead of http://www.mydomain.com/index.p开发者_Python百科hp/register

so I get an 404 error.

this problem occours only on production env, and not on development env.

any ideas ?

thanks!


Because no_script_name setting is set to "on" in production env.


There's a misspelling in your YML file:

resgister:
  url:     /register
  param:   { module: register, action: index }

should be

register:
  url:     /register
  param:   { module: register, action: index }

Use with:

echo link_to('register - here','@register');

This should fix the 404. The no_script_name is the reasons you don't see index.php as stated in several other answers.


You have to uncomment this line RewriteBase / in your /web/.htaccess file

# uncomment the following line, if you are having trouble
# getting no_script_name to work
#RewriteBase /

That will probably help :)

I assume you have the apache rewrite_module enabled

0

精彩评论

暂无评论...
验证码 换一张
取 消