Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 14th February 2007, 23:00
joshenry joshenry is offline
Member
 
Join Date: Jan 2007
Posts: 37
Thanks: 5
Thanked 0 Times in 0 Posts
Default mod_rewrite in iVhosts_ispconfig.conf get overwritten with change to domain...

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.
Reply With Quote
Sponsored Links
  #2  
Old 15th February 2007, 00:48
Dy0nisus Dy0nisus is offline
Member
 
Join Date: Jan 2007
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote
  #3  
Old 15th February 2007, 00:51
joshenry joshenry is offline
Member
 
Join Date: Jan 2007
Posts: 37
Thanks: 5
Thanked 0 Times in 0 Posts
Default

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?
Reply With Quote
  #4  
Old 15th February 2007, 09:29
martinfst martinfst is offline
Senior Member
 
Join Date: Dec 2006
Location: Hilversum, The Netherlands
Posts: 880
Thanks: 1
Thanked 18 Times in 17 Posts
Send a message via MSN to martinfst Send a message via Skype™ to martinfst
Default

Quote:
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.
Reply With Quote
  #5  
Old 15th February 2007, 10:35
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 37,041
Thanks: 841
Thanked 5,660 Times in 4,467 Posts
Default

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.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #6  
Old 15th February 2007, 17:19
joshenry joshenry is offline
Member
 
Join Date: Jan 2007
Posts: 37
Thanks: 5
Thanked 0 Times in 0 Posts
Default

Excellent, I'll give that a try.
Thanks again for your help.
Reply With Quote
  #7  
Old 15th February 2007, 19:34
joshenry joshenry is offline
Member
 
Join Date: Jan 2007
Posts: 37
Thanks: 5
Thanked 0 Times in 0 Posts
Default

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.
Reply With Quote
  #8  
Old 16th February 2007, 18:51
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,752 Times in 2,582 Posts
Default

Please try to use AllowOverride All in your main Apache configuration, as shown here: http://www.howtoforge.com/forums/sho...99&postcount=2
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #9  
Old 16th February 2007, 18:57
joshenry joshenry is offline
Member
 
Join Date: Jan 2007
Posts: 37
Thanks: 5
Thanked 0 Times in 0 Posts
Default

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.
Reply With Quote
  #10  
Old 16th February 2007, 19:08
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,752 Times in 2,582 Posts
 
Default

Maybe this page helps you: http://www.stevenhargrove.com/redirect-web-pages/
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Domain Change in website Jose Gosalbez Installation/Configuration 15 19th July 2006 13:38
I need to change the master domain minskog Installation/Configuration 5 7th July 2006 12:08
rebuild ssl certificates for domain change whitty Installation/Configuration 1 6th June 2006 13:12
Change of URL in Webmail in second domain jofranco General 1 8th May 2006 01:37
domain name change thedude General 2 15th August 2005 22:44


All times are GMT +2. The time now is 14:18.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.