Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8463113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:22:35+00:00 2026-06-10T14:22:35+00:00

I’m using Symfony2 on a shared server, and I’ve been trying to fix an

  • 0

I’m using Symfony2 on a shared server, and I’ve been trying to fix an issue I’m having. I want to get rid of the app.php landing page, and at the same time point to symfony’s web directory as the root directory.

So getting the root directory set up is easy.

<IfModule mod_rewrite.c>
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !^/symfony/web/
RewriteRule ^(.*)$ /symfony/web/$1 
</IfModule>

I’m stuck after this though. I tried

<IfModule mod_rewrite.c>
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !^/symfony/web/
RewriteRule ^(.*)$ /symfony/web/$1 

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ $1app.php [L] 

</IfModule>

Thinking that this would run sequentially. However, it doesn’t. Instead, it seems to look for both conditions, and then run both rules at the same time. For example, if I call example.com/app.php it will fetch example.com/symfony/web/app.phpapp.php . I’ve tried various combinations of various tags, and I’ve concluded that they simply always run at once, contrary to what I’ve read on the internet. The official doc is really sparse with examples, and doesn’t answer the problem I have.

Anyone have any ideas where I’m going wrong?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T14:22:37+00:00Added an answer on June 10, 2026 at 2:22 pm

    The following hid the need for app.php and pointed everything towards the right public folder. One thing to note, all public resources in symfony is stored in /web/bundles, while the only thing accessed in the web directly by a user is actually app.php.

    <IfModule mod_rewrite.c>
    RewriteEngine On
    
    RewriteCond %{REQUEST_URI} ^/bundles
    RewriteRule ^(.*)$ /symfony/web/$1 [L]
    
    RewriteCond %{REQUEST_URI} !^/symfony/web
    RewriteRule ^(.*)$ /symfony/web/app.php/$1 [L]
    
    </IfModule>
    

    It first looks for whether it’s /bundles, and then prepends symfony/web to it and stops there. Otherwise, it looks for whether /symfony/web is there and if not, prepends app.php to it and stops. Since I use symfony to generate all my urls in my php code, this doesn’t pose a problem.

    Preferably, it would see prepend symfony/web to everything, then test if it was a file, and if it wasn’t, it would add app.php to the end. Unfortunately, I couldn’t get it to work. Symfony does its own redirections when it detects a page doesn’t exist, and being inside a vhost just added more complexity, so this is as good as I can get it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am using Paperclip to handle profile photo uploads in my app. They upload
I'm trying to create an if statement in PHP that prevents a single post
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I would like to count the length of a string with PHP. The string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.