Apache rewrite issue for usermin

Hi,

I have installed virtualmin + webmin on CentOS 6. The url to access usermin is domain.tld:20000. I want to create an alias like webmail.domain.tld which rewrites to domain.tld:20000. Following is my virtual server config details in apache -

SuexecUserGroup "#510" "#507"
ServerName example.com
ServerAlias www.example.com
ServerAlias webmail.example.com
ServerAlias admin.example.com
DocumentRoot /home/example/public_html
ErrorLog /var/log/virtualmin/example.com_error_log
CustomLog /var/log/virtualmin/example.com_access_log combined
ScriptAlias /cgi-bin/ /home/example/cgi-bin/
ScriptAlias /awstats/ /home/example/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
 <directory home="" example="" public_html="">Options -Indexes +IncludesNOEXEC +FollowSymLinks +ExecCGI
allow from all
AllowOverride All
# gorav
AddHandler fcgid-script .php
AddHandler fcgid-script .php5
FCGIWrapper /home/example/fcgi-bin/php5.fcgi .php
FCGIWrapper /home/example/fcgi-bin/php5.fcgi .php5</directory> 
 <directory home="" example="" cgi-bin="">allow from all</directory> 
RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.example.com
RewriteRule ^(.*) https://example.com:20000/ [R]
RewriteCond %{HTTP_HOST} =admin.example.com
RewriteRule ^(.*) https://example.com:20001/ [R]
RemoveHandler .php
RemoveHandler .php5
IPCCommTimeout 31
 <files awstats.pl="">AuthName "example.com statistics"
AuthType Basic
AuthUserFile /home/example/.awstats-htpasswd
require valid-user</files> 
Alias /dav /home/example/public_html
Alias /pipermail /var/lib/mailman/archives/public
 <location dav="">DAV On
AuthType Basic
AuthName example.com
AuthUserFile /home/example/etc/dav.digest.passwd
Require valid-user
ForceType text/plain
Satisfy All
RemoveHandler .php
RemoveHandler .php5
RewriteEngine off</location> 
RedirectMatch /cgi-bin/mailman/([^/\.]*)(.cgi)?(.*) https://example.com:20001/virtualmin-mailman/unauthenticated/$1.cgi$3
RedirectMatch /mailman/([^/\.]*)(.cgi)?(.*) https://example.com:20001/virtualmin-mailman/unauthenticated/$1.cgi$3
php_value memory_limit 32M

But it is not redirecting properly. Can somebody please guide me what should I do.

Thanks and regards

Gorav

0 Replies

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct