Apache mod_rewrite Alias overridden by WordPress rewrite rules

I have a WordPress instance and a SimpleSAMLphp instance on the same box that needs to be accessed from the same sub domain and it seems like WordPress is interfering with the Apache Alias.

httpd.conf

Read More
#
# VHOST for the WordPress instance and provides an alias
# so simpleSAMLphp can be accessed at saml.domain.com/saml
#
<VirtualHost *:80>
        RewriteEngine On
        RewriteCond %{SERVER_PORT} !^443$
        RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]
</VirtualHost>
<VirtualHost *:443>
        ServerAdmin admin@domain.com
        ErrorLog logs/saml.domain.com-error_log
        CustomLog logs/saml.domain.com-access_log common

        SSLEngine On
        SSLCertificateFile /etc/pki/tls/certs/ca.crt
        SSLCertificateKeyFile /etc/pki/tls/private/ca.key

        RewriteLog "/var/log/httpd/mod_rewrite.log"

        ServerName saml.domain.com
        DocumentRoot "/var/www/html"
        <Directory "/var/www/html">
                Options All
                AllowOverride All
                Require all granted
        </Directory>

        Alias /saml "/var/simplesamlphp/www"
        <Directory "/var/simplesamlphp/www">
                Options All
                AllowOverride All
                Require all granted
        </Directory>
</VirtualHost>

.htaccess

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

/var/log/httpd/ssl_error_log

[Wed Mar 27 18:00:03 2013] [error] [client 10.0.3.133] File does not exist: /var/www/html/favicon.ico
[Wed Mar 27 18:00:05 2013] [error] [client 10.0.3.133] File does not exist: /var/www/simplesamlphp
[Wed Mar 27 18:00:05 2013] [error] [client 10.0.3.133] File does not exist: /var/www/html/favicon.ico
[Wed Mar 27 18:03:46 2013] [error] [client 10.0.3.133] File does not exist: /var/www/html/favicon.ico
[Wed Mar 27 18:03:47 2013] [error] [client 10.0.3.133] File does not exist: /var/www/html/favicon.ico
[Wed Mar 27 18:03:56 2013] [error] [client 10.0.3.133] File does not exist: /var/www/simplesamlphp

/var/log/httpd/mod_rewrite.log

The file is blank

http://saml.domain.com/saml = simpleSAMLphp administration menus.

http://saml.domain.com/anything-else = WordPress page(s)

The result of going to saml.domain.com/saml is a WordPress 404 page. I had this working before I forced SSL and fixed the WordPress rewrites so if anyone has any helpful information that would be great!

Thanks in advance!

Related posts

Leave a Reply

1 comment

  1. The problem was I had the SSL Vhost specified in /etc/httpd/conf/httpd.conf instead of /etc/httpd/conf.d/ssl.conf.

    The result of doing that was the deafult SSL Vhost that ships with Apache was overriding mine in httpd.conf. All I had to do was remove the SSL Vhost declaration in httpd.conf and merge it with the one in ssl.conf