wordpress - 如何编写 Mod Rewrite 来排除 Shibboleth url?

标签 wordpress apache .htaccess mod-rewrite shibboleth

我有一个安装了 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/

相关文章:

PHP tmux 和 screen 行为不正确(没有启动,没有新 session ,没有新窗口)

.htaccess - 如何使用 .htaccess 利用浏览器缓存? (谷歌地图 API)

.htaccess - 限制直接访问错误页面

jquery - WordPress Jquery 与插件冲突

php - 当有多个菜单时,丢失页面 id 在 li 的菜单上

php - 无法连接到树莓派上的php和mysql

php - Codeigniter 隐藏函数名称但保留功能

php - 通过 Apache .conf 文件忽略一个子目录中的 .htaccess 文件和规则

php - php中的动态函数名

php - 我如何通过 Wordpress 使用 jQuery UI?