1

I've been having this issue for quite some time. Right now we are using a shared hosting plan and have four domains, one of which points to a symfony project. My goal is simply to omit having the app.php included in the URL. Without any .htaccess applied, all domains work flawlessly and when trying to navigate to the symfony domain I simply get a directory listing instead of having the page render, unless I include the app.php in the URL.

When applying the below htaccess, all non-symfony related domains show a 500 error and the one symfony related domain renders successfully, without the app.php in the URL. My goal at this point is to modify the htaccess so that all non-symfony related domains render successfully as they did before, while still maintaining the below .htacces to omit the app.php from the Symfony related project.

I appreciate any suggestions on how to resolve this issue. Thanks in advance!

.htaccess

<IfModule mod_rewrite.c>
    Options +FollowSymlinks
    RewriteEngine On

    # Explicitly disable rewriting for front controllers
    RewriteRule ^app.php - [L]

    RewriteCond %{REQUEST_FILENAME} !-f

    # Change below before deploying to production
    RewriteRule ^(.*)$ /app.php [QSA,L]
</IfModule>

1 Answer 1

2

Replace the line :

RewriteCond %{REQUEST_FILENAME} !-f

With :

RewriteCond %{REQUEST_FILENAME} -f
RewriteRule .? - [L]
Sign up to request clarification or add additional context in comments.

3 Comments

Thanks for the reply. It seems to be somewhat working. Two of my domains are up (one being non-symfony related), the other two are still down. Previously all but one were down, so slightly better than before :)
Talked to customer support and they said the other sites are down due to excessive redirects that cannot be completed.
If you use Apache 2.2.16 or higher, you can use the FallbackResource directive

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.