1

The app.php is hidden from url like this:

RewriteEngine On

#<IfModule mod_vhost_alias.c>
#    RewriteBase /
#</IfModule>

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

But before it, there is: /symfony/web/

How to hide it?

1

1 Answer 1

2

Change your DocumentRoot in your Apache configuration to point to the web/ directory.

Edit /etc/httpd/conf/extra/httpd-vhost.conf (your path may vary when using other distributions like Ubuntu):

...
<VirtualHost *:80>
    ...
    DocumentRoot /path/to/your/webapp/symfony/web

    <Directory /path/to/your/webapp/symfony/web>
        ...
    </Directory>
</VirtualHost>
Sign up to request clarification or add additional context in comments.

4 Comments

okay will try it in momemt but the .htaccess is working in /web at my localhost. But not working on different server. Any ideas why? And the error is: Forbidden You don't have permission to access /symfony/web/ on this server.
Check if the (*nix) file permissions are correctly set and owned by the same user/group where your webserver process is running as well as you don't exclude any users in your webserver config (Order allow,deny etc.)
I am not sure what u mean .. please i am noob in this stuff. But this is how ls looks like upnito.sk/0/tn7gmym434bn3qv3c6dyxz2ntbgvb2vq.png
mod_rewrite is not the important thing here, it's the Apache config. If you're a noob start reading something about Apache vhost-configuration and about how to setup Symfony2 applications - the step you're trying to achieve is mentioned in the beginner's tutorial of Symfony2...

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.