Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

i want to access to http://admin.my-app.com

It is supposed to point on web/backend.php, but when i try to access via the URL, it redirects me to the index.php of my application.

I don't know what i've done wrong.

    <VirtualHost *:80>
        ServerName admin.my-app.com

        DocumentRoot /var/www/myapp/web
        DirectoryIndex backend.php
        <Directory /var/www/myapp/web>
                AllowOverride none
                allow from all
        </Directory>

         Alias /sf /var/www/myapp/lib/vendor/symfony/data/web/sf
          <Directory "/var/www/myapp/lib/vendor/symfony/data/web/sf">
                 AllowOverride none
                 Allow from All
          </Directory>

        ServerSignature Off
</VirtualHost>

And it takes me to :

    <VirtualHost *:80>
        ServerName www.my-app.com

        DocumentRoot /var/www/myapp/web
        DirectoryIndex index.php
        <Directory /var/www/myapp/web>
                AllowOverride All
                allow from all
        </Directory>

         Alias /sf /var/www/myapp/lib/vendor/symfony/data/web/sf
          <Directory "/var/www/myapp/lib/vendor/symfony/data/web/sf">
                 AllowOverride All
                 Allow from All
        </Directory>
        ServerSignature Off
</VirtualHost>

and the .htaccess

    Options +FollowSymLinks +ExecCGI

<IfModule mod_rewrite.c>
  RewriteEngine On
  #RewriteBase /
  RewriteCond %{HTTP_HOST} ^my-app.com
  RewriteRule (.*) http://www.my-app.com/$1 [R=301,L]
  RewriteRule ^$ index.html [QSA]
  RewriteRule ^([^.]+)$ $1.html [QSA]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>

Thank you ;)

share|improve this question
add comment

1 Answer 1

Isn't the last RewiteRule in your .htaccess setting it to index.php?

share|improve this answer
    
I've disallowed appache to look for the .htaccess when accessing to admin.my-app.com by removing AllowOverride (or setting it to none) –  Tristan Nov 16 '10 at 23:58
    
Do you have vhost logs? Do you actually see it going to admin vhost? –  icyrock.com Nov 17 '10 at 0:19
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.