我有一个安装了 Shibboleth 插件的 WordPress 网站,它使用 Shibboleth 来验证用户身份。
网站网址:www.mytestsite.com/wordpress/blog
我想从 url 中删除子目录,所以我按照下面的 url 完成了它
http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory
现在,我可以在没有子目录的情况下访问博客
网站网址:www.mytestsite.com/blog
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
但是现在 shibboleth 身份验证不起作用,因为 apache 正在尝试在 wordpress 中查找 shibboleth 网址并显示找不到页面。
我需要编写一个 RewriteCond 来排除 shibboleth url。
shibboleth 网址是:
www.mytestsite.com/Shibboleth.sso/登录
www.mytestsite.com/Shibboleth.sso/Logout
www.mytestsite.com/Shibboleth.sso/Session
我需要帮助为上述网址编写 RewriteCond 规则,请帮忙。
最佳答案
另一种选择,(根据我的评论):
RewriteCond %{REQUEST_URI} !\.sso/ # exclude Shibboleth extensions
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
...向第二个 RewriteRule 组添加另一个条件,排除包含点-s-s-o-正斜杠的请求。 :)
关于wordpress - 如何编写 Mod Rewrite 来排除 Shibboleth url?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28749686/