How to write a Mod Rewrite to exclude Shibboleth urls?

I have a wordpress site with Shibboleth plugin installed, Which uses Shibboleth to authenticate users.

Site url : www.mytestsite.com/wordpress/blog

Read More

I wanted to remove the subdirectory from the url so, I followed the below url and accomplished it

http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

Now, I can access the blog without the subdirectory

Site url : www.mytestsite.com/blog

The htaccess file looks like this

# 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

but now shibboleth authentication does not work because apache is tring to find shibboleth urls in wordpress and displays page is not found.

I’ll need to write a RewriteCond which would exclude shibboleth urls.

the shibboleth url are:

www.mytestsite.com/Shibboleth.sso/Login

www.mytestsite.com/Shibboleth.sso/Logout

www.mytestsite.com/Shibboleth.sso/Session

I need help in writing the RewriteCond rule for the above urls, kindly help.

Related posts

Leave a Reply

2 comments

  1. Another option, (as per my comment under question):

    RewriteCond %{REQUEST_URI} !.sso/ # exclude Shibboleth extensions
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    

    …add another condition to the second RewriteRule group, excluding requests that contain a dot-s-s-o-forward slash. 🙂

  2. You can use:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    
    # ignore Shibboleth.sso and index.php from rewrite
    RewriteRule ^index.php|Shibboleth.sso$ - [L,NC]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress