This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » support » Installation and setup » symfony without pretty urls
symfony without pretty urls [message #102068] Tue, 06 July 2010 14:38 Go to next message
Flinsch  is currently offline Flinsch
Messages: 3
Registered: July 2010
Location: Münster, Germany
Junior Member
Hello everybody,

I recently started working on a new PHP project using symfony. It is the first time I'm using symfony and as everything works fine on my local machine (until now), I have problems running the app on the remote internet machine:

I have no access to the web server configuration and I cannot apply any .htaccess modifications (as all .htaccess files promptly disappear when they are created on or copied to the server). Because of that, I cannot use pretty urls as they cannot be interpreted correctly. I don't care! But then I need to know, how to get symfony working without pretty urls? It feels like I searched the complete internet, but all advices I found for disabling pretty urls are regarding cakePHP.

I already tried some things like modifying routing.yml to let the urls look like "?url=/:module/:action/*" or something like that, but it didn't work.

Is there any solution for using symfony without pretty urls? Or is there any other solution for using symfony regarding my problem more generally, not having access to the web server configuration and the permission to apply .htaccess modifications.

Thanks a lot in advance!
Cheers,
Flinsch.
Re: symfony without pretty urls [message #102074 is a reply to message #102068 ] Tue, 06 July 2010 15:46 Go to previous messageGo to next message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
Sure, just use: http://server/index.php/your/routing/url


Remember Palestine
Re: symfony without pretty urls [message #102079 is a reply to message #102074 ] Tue, 06 July 2010 16:30 Go to previous messageGo to next message
Flinsch  is currently offline Flinsch
Messages: 3
Registered: July 2010
Location: Münster, Germany
Junior Member
Ok, that seems to work. Thanks a lot for your respone so far.

How can I set the target file name like 'index.php' as a prefix into the generated urls without changing related parts of the code? Or do I have to change these code snippets manually?

For example, I have a form tag:
<form action="<?php echo url_for('session/create') ?>" method="post">

A solution that works fine is to modify the action to:
<form action="index.php<?php echo url_for('session/create') ?>" method="post">

But I don't want to modify all those code snippets.

Maybe there is a possibility to override the url_for behavior?

Thanks a lot!
Flinsch.
Re: symfony without pretty urls [message #102081 is a reply to message #102068 ] Tue, 06 July 2010 17:08 Go to previous messageGo to next message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
Yep, reset the value of no_script_name for the environment in question (or all environments if you wish). It's in your settings.yml.

[Updated on: Tue, 06 July 2010 17:08]


Remember Palestine
Re: symfony without pretty urls [message #102088 is a reply to message #102081 ] Tue, 06 July 2010 17:38 Go to previous message
Flinsch  is currently offline Flinsch
Messages: 3
Registered: July 2010
Location: Münster, Germany
Junior Member
Wow, thank you very much: That works perfect!
I can't tell how long I've been searching for this solution Wink
Kind regards,
Flinsch.
Previous Topic:Shared-host install et htaccess pb
Next Topic:MAMP / Symfony 1.4.6 - Pear include issue
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software