views:

46

answers:

1

Hi, Is there a way or at least a workaround on masking default webmail urls or disabling access webmail urls so users will not be able to change their passwords?

Website is PHP based and is using apache server under a shared hosting account. The thing is that http://domain.com/webmail will let users access the main panel where they can change their individual passwords. We do not need this. Most solutions point to changing httpd.conf which we are not allowed to change since this is on a shared hosting service.

I'm looking for at least a workaround to this issue. How about disabling it through their browsers if my client is under a network server, this would be a decent workaround isn't it? or are there any more suggestions aside from this?

Please help. This is my urgent issue.

Thank you very much!

A: 

If you wanted to direct all requests to "http://domain.com/webmail" to "http://domain.com/webmail/address/" (made up URL here - I'm assuming you're taking them to an alternate page).

Add a ".htaccess" file with the following rule:

RewriteEngine on
RewriteRule ^webmail/ /webmail/address/ [NC,R=301]

Alternate solution...

The page that exists at "http://domain.com/webmail/index.php" - you could check the address in this page and put a redirect header to the page you want them to go to...

if ($_SERVER['REQUEST_URI'] == 'http://domain.com/webmail/') {
    header('Location: http://domain.com/webmail/address/');
}

It is important that this code goes near the very top of the page, before you have echo'd or print'd anything to the output buffer.

Sohnee
i tried other htaccess methods and yours as well but does not seem to work.. the domain i'm referring to is actually a subdomain of my master domain. that might make a difference?
jan
If mod_rewrite isn't available, my new alternate answer may help.
Sohnee
I appreciate your help very much!mod_rewrite is available and i have tested it. I don't know why htaccess won't get read when webmail is access using this: http://mydomain.com/webmail. I also thought about your other solution before but It seems that webmail is hidden somewhere on the root level where i do not have access since this is also a shared hosting server... any more ideas perhaps?
jan
@jan - your comment there leads me to suspect that you can't solve this problem. I thought you were hosting the webmail app on your site. What is more likely the case is that your hosting company has set up a domain record for the URL that actually points to their own webmail hosting server. i.e. http://domain.com/webmail/ is not on your website at all (which is why your .htaccess file won't have any effect).
Sohnee
that's what i feared about. I was hoping someone else encountered the same issue, but then again I guess this issue is unsolvable. But thanks Sohnee for the insistent help I appreciate it much.
jan