Php 如何基于客户端',将Apache/mod_重写重定向客户端到特定URL;Drupal中的IP是什么?
我有一个内部(LAN)和外部发布的Apache web服务器,http.conf如下所示:Php 如何基于客户端',将Apache/mod_重写重定向客户端到特定URL;Drupal中的IP是什么?,php,apache,.htaccess,mod-rewrite,drupal,Php,Apache,.htaccess,Mod Rewrite,Drupal,我有一个内部(LAN)和外部发布的Apache web服务器,http.conf如下所示: <VirtualHost xxx.xxx.xxx.xxx:443> ServerName intradev.xxxx.com ServerAlias intradev.xxxx.com DocumentRoot /var/www/intranet/ SSLEngine On SSLCertificateFile /etc/2014.crt
<VirtualHost xxx.xxx.xxx.xxx:443>
ServerName intradev.xxxx.com
ServerAlias intradev.xxxx.com
DocumentRoot /var/www/intranet/
SSLEngine On
SSLCertificateFile /etc/2014.crt
SSLCertificateKeyFile /etc/2014.key
SSLCertificateChainFile /etc/ca_bundle.crt
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/intranet/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
<Location /user/login/sso>
AuthType GSSAPI
AuthName "Login SSO"
Require valid-user
GssapiCredStore keytab:/etc/krb5.keytab
GssapiCredStore ccache:MEMORY:user_ccache
GssapiUseSessions On
Session On
SessionCookieName gssapi_session path=/private;httponly;secure;
</Location>
LogLevel debug
但是,一旦我把它添加到块下,我就会看到一个页面无法显示
如果我将重写规则更改为类似,并点击局域网上的web服务器,它会将我重定向到google OK
我想让它做的是,任何点击路径的LAN用户首先被重定向到/user/login/sso
也许mod_rewrite不是这样做的正确地方?还有其他建议吗?内联网是一个Drupal支持的网站。这不应该在Drupal中处理吗?我想你可以用它的核心功能来做这件事。只需删除匿名用户的“查看任何内容”权限,看看是否有效。只需留下经过身份验证的用户。我认为,因为这是基于PHP身份验证的,所以可能应该使用code/cms来处理
我认为这不管用,但您确实为我指明了使用drupal模块的正确方向;在我的例子中,规则模块和定制PHP。
RewriteEngine On
RewriteCond %{REMOTE_HOST} 172.16. [NC,OR]
RewriteRule .* https://intranet.xxxx.com/user/login/sso [R=301,L]