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 7974039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:15:41+00:00 2026-06-04T08:15:41+00:00

I have a symfony 2 website which requires all urls to be re-written to

  • 0

I have a symfony 2 website which requires all urls to be re-written to the document index.

Additionally, there are a number of completely independent “micro sites” which just run out of their own sub-folders in the web directory. I need to add re-write exceptions for any urls that point to the microsite sub folders

This is my .htaccess file:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_URI} !^/(microsite1|microsite2|microsite3)(.*)$
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ %{document_index} [QSA,L]
</IfModule>

This works for everything except .php files within the microsite folders, i.e:

  • http://www.domain.com/microsite1/index.html —works (displays index.html)
  • http://www.domain.com/microsite2/ —works (displays index.php)
  • http://www.domain.com/microsite2/contact.php — doesn’t work (displays symfony route not found error)

aditionally:

  • http://www.domain.com/microsite2/images/ —successfully displays directory listing
  • http://www.domain.com/microsite2/images/image.jpg — successfully displays image
  • 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-04T08:15:42+00:00Added an answer on June 4, 2026 at 8:15 am

    You might need to change your apache config to something like this:

    <VirtualHost *:80>
        ServerName server-name
        DocumentRoot /var/www/path/to/document/root
        <Location />
                RewriteEngine on
                RewriteCond %{REQUEST_FILENAME} !-f
                RewriteCond %{REQUEST_FILENAME} !-d
                RewriteRule !\.(js|ico|gif|jpg|png|css)$ /index.php
        </Location>
    </VirtualHost>
    

    Paying close attention to the last RewriteRule…

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

Sidebar

Related Questions

I have a symfony project. There is a website and a rest API that
I am using symfony 1.0 and have set routing for few URLs as below.
I'm working on rebuilding the UI portion of our website which is all heavily
I am trying to have a language switcher on my symfony 2.1 website. I
We have a website that developed in symfony 1.4 framework. This website should be
I have a question about symfony. I'm working on a website and everything was
I have a question here. I have a website running on symfony 1.0. I
I am using Symfony 1.2.9 (with Propel ORM), to build a website. I have
I'm using symfony to develop a website and have it mostly functioning, but I
I have a Document Entity and I want that the user of the website

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.