Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 7 of 7

This is a discussion on Problems Deploying Symfony - modrewrite in the Shared & Semi-Dedicated forum
I am having problems deploying symfony. is seems mod rewrite is not working the way i expect it to. I have th folowing in my ...

  1. #1
    JPC Member
    Join Date
    May 2008
    Location
    Amsterdam
    Posts
    3

    Problems Deploying Symfony - modrewrite

    I am having problems deploying symfony. is seems mod rewrite is not working the way i expect it to. I have th folowing in my .htaccess file which works on my laptop but that uses apache2.2. does any one have any experience lik this or know how to modify the the .htaccess file to get it working. sorry but i have no experience with mod rewrite

    many thanks

    Julian

    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
    # comment the following 3 lines to allow periods in routes
    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>

    # big crash from our front web controller
    ErrorDocument 500 "<h2>Application error</h2>symfony application failed to start properly"

  2. #2
    JPC Member
    Join Date
    May 2008
    Posts
    1
    I have problems with .htaccess too.

    Please help me! My .htaccess not working.

    Options +FollowSymlinks
    RewriteEngine On
    RewriteRule ^home(.*)?$ index.php?s=home

    Result: Error 404 but index.php?s=home exists and work!

  3. #3
    JPC Member
    Join Date
    May 2008
    Location
    Amsterdam
    Posts
    3
    I solved my problem. the answer was to change

    # no, so we redirect to our front web controller
    RewriteRule ^(.*)$ index.php [QSA,L]
    </IfModule>


    to

    # no, so we redirect to our front web controller
    RewriteRule ^(.*)$ /web/index.php [QSA,L]
    </IfModule>


    J

  4. #4
    the Windlord Gwaihir's Avatar
    Join Date
    Jun 2002
    Posts
    2,562
    juliany,

    In that case you have not deployed symfony as intended. The idea is to place the contents of the folder /web directly under the web (or site) root. In other words: symphony's /web is jagpc's /public_html. The other folders can be outside the web root, which is safer. (AFAIK Symfony was made with this structure in mind, so perhaps it's even necessary to be safe at all.) If you put them directly into your home directory, you probably needn't change anything else.

    So that becomes:
    - Copy the Symphony project to your home folder (that's /home/accountname)
    - Move the stuff in /web to /public_html and remove /web

    Have you also "frozen" your project for deployment, i.e. included all the framework parts inside the project file structure (rather than hope for a central PEAR install)?
    Regards,

    Wim Heemskerk
    ---
    Visit MeCCG.net - Cardgaming in J.R.R. Tolkien's Middle-earth
    And Gwaihir.net - The Middle-earth CCG store

  5. #5
    JPC Member
    Join Date
    May 2008
    Location
    Amsterdam
    Posts
    3
    Hi Wim,

    I redeployed using only the web dir for a addon domain

    and yes I also did a freeze

    I removed the .htaccess file and that did nothing

    the app is at http://www.millercollegeproject.com/

    if you have any more ideas i would be so greatfull

    J

  6. #6
    the Windlord Gwaihir's Avatar
    Join Date
    Jun 2002
    Posts
    2,562
    Ok, so it's on an add on domain. In that case: /home/julianyo/public_html/millercollegeproject/ is symfony's /web folder.

    All the other folders should go way up. You could for example make a folder /home/julianyo/millercollegeproject/ and put them there.

    There should be a setting somewhere (in the index.php?) that references where this folder is.

    BTW: Are you showing the development / debugging front controller on purpose?
    Last edited by Gwaihir; 05-28-2008 at 03:20 PM. Reason: not looked properly..
    Regards,

    Wim Heemskerk
    ---
    Visit MeCCG.net - Cardgaming in J.R.R. Tolkien's Middle-earth
    And Gwaihir.net - The Middle-earth CCG store

  7. #7
    the Windlord Gwaihir's Avatar
    Join Date
    Jun 2002
    Posts
    2,562
    A yes, to make the two parts find eachother once in those places:
    - Set the SF_ROOT_DIR constant on top of your front controller(s), http://www.symfony-project.org/book/...t%20Controller
    - Set the sf_web_dir in your application´s config file http://www.symfony-project.org/book/...-Host%20Server

    I *think* that should do it. (I´ve only ever used symfony as the one thing running on a dedicated server. So I´ve not had to fool around with this.)
    Regards,

    Wim Heemskerk
    ---
    Visit MeCCG.net - Cardgaming in J.R.R. Tolkien's Middle-earth
    And Gwaihir.net - The Middle-earth CCG store

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •