.htaccess question?

mikelato

Verified User
Joined
Jan 25, 2010
Messages
74
Hi,

I have my .htaccess file setup to forward certain URLs that I would like every new user to have as well.

For example, when you go to mydomain.com/mail it forwards to squirrelmail. So when a new user is created I would like an .htaccess file created so when the user goes to certain urls they are forwarded where I want them to go.

I have SSL setup on directadmin so the users cannot access the control panel with theirdomain.com:2222 they need to go to https://www.mydomain.com:2222 so I would like a forwarder setup on every new account so they when a user goes to theirdomain.com/cp it takes them to https://www.mydomain.com:2222.

Is there any way to do this, or is there a better way to do what I am trying to do?

Thanks,
Mike
 
It does that by default. Check /etc/httpd/conf/extra/httpd-alias.conf and set the appropriate switch. Then check /var/www/html/redirect.html
 
It didn't do it for my previous accounts that I had made but I'll check the switch and post my results here, thanks for your help.
 
OK!

1. Go to /usr/local/directadmin/data/templates/custom and add

<VirtualHost |IP|:80>

ServerName cp.|DOMAIN|
Redirect / https://www.yourdomain.com:2222

</VirtualHost>
in virtual_host.conf and virtual_host2.conf and save.
2. Run echo "action=rewrite&value=httpd" >> /usr/local/directadmin/data/task.queue
3. Go to /usr/local/directadmin/data/templates find dns_a.conf and add cp=|IP| (I don't know how you can rewrite named files for all user, maybe some one can help you with that.) But it will be done for new users or you can put cp with your server IP for each user manually.

And just inform your users about that new link to access Control Panel is cp.domain.com

Hope it was helpfull! :)
 
Last edited:
Back
Top