trq Posted August 5, 2008 Share Posted August 5, 2008 this part was really confusing me <VirtualHost> ServerName mydomain.com ServerAlias www.mydomain.com DocumentRoot /www/mydomain.com // and this here </VirtualHost> <VirtualHost> ServerName mail.mydomain.com DocumentRoot /www/mail.mydomain.com //this here </VirtualHost> But I got it working ne how by trying different combos finally got it working by say this instead DocumentRoot mypath/webmail //WITHOUT THE mail.mydomain.com.. that is what is so confusing about it.. and all the examples have this. but i did get it working.. thanks for the help thorpe.. Yeah, those examples are based on the fact that I normally name my directories the same as the domains that point to them. Just seems more logical when you have many different domains. Quote Link to comment https://forums.phpfreaks.com/topic/117965-help-with-301-redirects/page/2/#findComment-609073 Share on other sites More sharing options...
ag3nt42 Posted August 6, 2008 Author Share Posted August 6, 2008 well I thought I had this solved last nite but I do not.. Once I went back and checked mail.mysite.com it worked and went to the right place.. but then once I checked mysite.com it went to the same place as mail.mysite.com and it should not.. I tried messing around with it alot last nite but to no avail. so its still not working for me.. Once I thought I had it but then it said that my website was requiring that I login. and neither mail.mysite.com or mysite.com would work. I'm finding it hard to believe this is so simple being that I've setup everything else with such ease.. I mean installing and configuring apache with mysql and php5 was easier time then i'm having with this. the examples on apache.org say to do this NameVirtualServer *:80 <VirtualHost *:80> ServerName mail.mysite.com DocumentRoot /htdocs/webmail //Still getting confused on this part.. where does the this start at? </VirtualHost> <VirtualHost *:80> ServerName mysite.com DocumentRoot /htdocs </VirtualHost> my web root is htdocs.. the default for apache. when i put the above code into my httpd.conf file thats when I get the "This website requires you to login" message when I take it back out it all just goes to the webroot. Am I missing something? should I make a new set of directories?? I seen an example that said to do this c:/vhosts/site1 and c:/vhosts/site2 do you think that would be better then just htdocs and htdocs/webmail? Quote Link to comment https://forums.phpfreaks.com/topic/117965-help-with-301-redirects/page/2/#findComment-609624 Share on other sites More sharing options...
trq Posted August 6, 2008 Share Posted August 6, 2008 Am I missing something? I thought you where using windows? Your paths should look more like... NameVirtualServer *:80 <VirtualHost *:80> ServerName mail.mysite.com DocumentRoot "C:\htdocs\webmail" //Still getting confused on this part.. where does the this start at? </VirtualHost> <VirtualHost *:80> ServerName mysite.com DocumentRoot "C:\htdocs" </VirtualHost> Should they not? Sorry, I'm not a windows user, but that makes more sense to me in a windows environment. What does the DocumentRoot directive look like in the main section of your httpd.conf file? That will give you a hint as to how these others should be written. Quote Link to comment https://forums.phpfreaks.com/topic/117965-help-with-301-redirects/page/2/#findComment-609641 Share on other sites More sharing options...
ag3nt42 Posted August 6, 2008 Author Share Posted August 6, 2008 well in the norm its says C:\blah\blah\htdocs like you say.. but the examples said it should be the other way.. I'll try that tonite and see if that works. why would I be getting the "This website requires you to login" message tho? Quote Link to comment https://forums.phpfreaks.com/topic/117965-help-with-301-redirects/page/2/#findComment-609643 Share on other sites More sharing options...
trq Posted August 6, 2008 Share Posted August 6, 2008 well in the norm its says C:\blah\blah\htdocs like you say.. but the examples said it should be the other way.. yeah, because most examples are written for *nix, not windows. why would I be getting the "This website requires you to login" message tho? Have you got a router connecting you to the internet via adsl? I used to get a pop-up login prompt generated by my router when I tried to go to a site that did not exist. This was in fact the prompt to login to my routers config. Maybe you have something similar? Quote Link to comment https://forums.phpfreaks.com/topic/117965-help-with-301-redirects/page/2/#findComment-609669 Share on other sites More sharing options...
ag3nt42 Posted August 6, 2008 Author Share Posted August 6, 2008 no i'm running broadband cable strait to the modem it doesn't prompt me to login.. it just tells me that the website requires it. Quote Link to comment https://forums.phpfreaks.com/topic/117965-help-with-301-redirects/page/2/#findComment-609677 Share on other sites More sharing options...
trq Posted August 6, 2008 Share Posted August 6, 2008 Yeah, I have no idea. Fix your doc roots and lets see if it persists. Quote Link to comment https://forums.phpfreaks.com/topic/117965-help-with-301-redirects/page/2/#findComment-609702 Share on other sites More sharing options...
ag3nt42 Posted August 6, 2008 Author Share Posted August 6, 2008 ok..have to wait till i'm home tho. Quote Link to comment https://forums.phpfreaks.com/topic/117965-help-with-301-redirects/page/2/#findComment-609730 Share on other sites More sharing options...
ag3nt42 Posted August 6, 2008 Author Share Posted August 6, 2008 Yup that did it.. working well now.. with this config NamVirtualHost *:80 <VirtualHost *:80> ServerName www.mysite.com ServerAlias mysite.com DocumentRoot C:\blah\blah\htdocs </VirtualHost> <VirtualHost *:80> ServerName mail.mysite.com DocumentRoot C:\blah\blah\htdocs\webmail </VirtualHost> Quote Link to comment https://forums.phpfreaks.com/topic/117965-help-with-301-redirects/page/2/#findComment-610178 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.