Hey, I've been trying to find a place where I can put a rewrite to go from http://*.mydomain.com/webmail -> https://www.mydomain.com/webmail. I've got it working however if I ever make a change to the domain it will over write the Vhosts_istpconfig.conf file and then it won't work anymore. Is there another place where apache will find the rewrite and process it properly? I've tried in the httpd.conf file, as well as .htaccess file with no go. Thanks for any assistance.
Hi! Everytime you make a change to a Web, ISPConfig rewrites the vhost - file of Apache. You have to implement your rewrite - rule in the config file that is responsible for creating the config file ... edit: Code: /root/ispconfig/scripts/lib/config.lib.php
Gah... :-/ don't know where I need to add the information in that file. Am I able to add it in a different place in httpd.conf or anything like that?
Rewrite rules also work in .htaccess files, which you can put in your web directory, These won't be overridden.
The correct solution is either to add the rwrite rule in a .htaccess file as martinfst pointed out or to add it in the apache directives field of the website in ISPConfig. The content of the apache directives field is inserted in the vhost by ISPConfig. Vhosts_istpconfig.conf shall never be dited manually and editing the config.lib.php is also not recommended beacuse you will loose all cahnges when you update ISPConfig.
I can't seem to get the .htaccess file to see the rewrite rules. If I put a redirect in there that will work to a point but isn't going to do what I want it to do. Here is what I'm trying to do. If someone accesses: http://webmail.mydomain.com https://webmail.mydomain.com http://*.mydomain.com/webmail https://*(other then www).mydomain.com/webmail I need it to go to: https://www.mydomain.com/webmail I think I have the rule right: RewriteEngine On RewriteCond %{HTTP_HOST} webmail.mydomain.com$ [NC] RewriteRule ^/(.*)$ https://webmail.mydomain.com/$1 [R,L] RewriteRule ^/webmail/(.*)$ https://webmail.mydomain.com/$1 [R,L] I've seen people writing rewrite rules in <IfModule mod_rewrite.c></IfModule> tags, I've tried with and without either way the site will not access any rewrite command I put in there. Thanks again for any help.
Please try to use AllowOverride All in your main Apache configuration, as shown here: http://www.howtoforge.com/forums/showpost.php?p=48399&postcount=2
Yup, checked that and changed it so the web dir has AllowOverride All applied to it. Commands in the .htaccess in the /web dir work just not the rewrite command. I tried a redirect and it works but I need a rewrite cause the redirect doesn't do what I want it to. Thanks again.