Forum Moderators: phranque
The webmail pages need a .htaccess file to redirect specific urls to the main site (usualy after webmail logs out). The goal is to redirect to the home page when they log out of webmail. Many new users will get lost without this.
rewriterule catches attempts for [webmail.example.com...] and redirects to [example.com...] that's ok. (the webmail login is on www anyway...)
However, this walk-through demonstrates where it does not work.
Start -> [example.com...]
Type in your user+password for webmail, and hit login.
Action ->
[webmail.example.com...]
Read email, send email, delete email, do stuff.
Logout of webmail ->
[webmail.example.com...]
I've tried multiple rewriterules to try and match this. (all in .htaccess, either in the docroot, or in cgi-bin)
The rewrite log, at level 2 shows NOTHING when accessing /cgi-bin*, however, it runs as expected for other locations (eg, a virtualized directory structure mapped to a php script one of the non webmail hosts)
It's not feasable (imo) to put these rewrites in the httpd.conf. I'm willing to open up access specific to this function, to allow it to operate.
I'm still at odds with it. It's to my (possibly misguided) understanding that allowoverrides and options directives will not affect mod_rewrite or its directives.
Thank you!
Scott
PS, have a happy GNU year ;-)
Welcome to WebmasterWorld [webmasterworld.com]!
> allowoverrides and options directives will not affect mod_rewrite or its directives.
AllowOverides Fileinfo is required on some servers.
If Options FollowSymLinks is not set in httpd.conf, then AllowOverrides Options must be set so that Options +FollowSymLinks can be set in the .htaccess context.
In addition, you may find that setting AllowOverrides Limit is to your advantage.
If you'll post your code for redirecting http://webmail.example.com/cgi-bin/webmail?index=1, we can discuss it. Unless you or your host have added some specific restriction associated with /cgi-bin/, it should be simple enough to check the query sring with RewriteCond and the URI with RewriteRule.
Jim
.htaccess:
RewriteEngine ONRewriteCond %{QUERY_STRING} ^index=1$
RewriteRule ^webmail$ [example.com...] [R,L]
This is working now. I'd like to quell the query string. Currently you'll get [example.com...] because before rewriting the url was [webmail.example.com...]