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 have three separate dvhost configurations on sites-available and one of them contains:

RewriteEngine On
RewriteRule ^/$ /app/login.axvw [R]

The major problem is that it redirects all other vhost roots to /app/login.axvw too.

Full vhost conf:

Edit. Added full conf of one vhost:

<VirtualHost *:80>
    ServerName sub.domain.com
    ServerAlias sub.domain

        redirect / https://sub.domain.com/app/login.axvw

        ErrorLog ${APACHE_LOG_DIR}/sub.domain_error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog ${APACHE_LOG_DIR}/sub.domain_access.log combined

</VirtualHost>

<VirtualHost *:443>
        ServerName sub.domain.com

        SSLEngine on
        SSLCertificateFile    /etc/apache2/ssl.crt/domain.com.crt
        SSLCertificateKeyFile /etc/apache2/ssl.key/domain.com.key
        SSLCertificateChainFile /etc/apache2/ssl.crt/gd_bundle.crt

RewriteEngine On
RewriteRule ^/$ /app/login.axvw [R]

#       redirect / https://sub.domain.com/app/login.axvw
    ProxyRequests Off

    ProxyPass / ajp://sub.domain.com:8009/
    ProxyPassReverse / https://sub.domain.com

    <Location />
        Order allow,deny
        Allow from all
    </Location>

        ErrorLog ${APACHE_LOG_DIR}/sub.domain_error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog ${APACHE_LOG_DIR}/sub.domain_access.log combined


</VirtualHost>
share|improve this question
    
Can you post the complete configuration if convenient? –  Khaled Jan 16 '13 at 8:20
    
I must add that this is name based setup for vhosts. Server has one IP. –  user1492810 Jan 16 '13 at 8:51

1 Answer 1

Ditch the rewrite and use Redirectmatch instead; save your sanity for when things get really interesting.

Redirectmatch ^/$ https://sub.domain.com/app/login.axvw
share|improve this answer
    
This causes same problem. When I have sub2.domain.com then it's root is redirected to /app/login.axvw –  user1492810 Jan 16 '13 at 12:56

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.