views:

127

answers:

3

hey fellas,

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.php/register

so I get an 404 error.

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

any ideas ?

thanks!

+1  A: 

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

develop7
A: 

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

Attila Koteles
I thought he wants not to use `no_script_name`
develop7
Or he might just wondering why he gets the links without the index.php - and you're right because of the no_script_name settingBut the reason for 404 error is that he might have a badly set up mod_rewrite. Otherwise the change in .htaccess could solve it.
Attila Koteles
+2  A: 

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.

Jestep