Forum Moderators: phranque

Message Too Old, No Replies

Apache2 Default Server Redirect problem

         

cgkhwebservices

1:31 pm on Jul 24, 2014 (gmt 0)

10+ Year Member



I have just configured Apache2 on a vps with 3 domains.

I have managed to get all the domains and the http: ip address of the server to point to the correct directory WITH the exception of the following:

http://xx.xxx.xxx.xxx points to the correct virtual www. directory and serves pages correctly
http://example.com points to the correct virtual www. directory and serves pages correctly

However, http://example.com points to the correct virtual www. directory in the vhost conf file and BUT serves an error message.

I must be missing something but what?

The first part of the relevant vhosts file is as follows:

"<Directory /var/www/example.com>
AllowOverride None
Order Deny,Allow
Deny from all
</Directory>

<VirtualHost *:80>
DocumentRoot /var/www/example.com/web

ServerName example.com
ServerAlias www.example.com
ServerAdmin webmaster@example.com

ErrorLog /var/log/ispconfig/httpd/example.com/error.log

Alias /error/ "/var/www/example.com/web/error/"
ErrorDocument 400 /error/400.html
ErrorDocument 401 /error/401.html
ErrorDocument 403 /error/403.html
ErrorDocument 404 /error/404.html
ErrorDocument 405 /error/405.html
ErrorDocument 500 /error/500.html
ErrorDocument 502 /error/502.html
ErrorDocument 503 /error/503.html

<IfModule mod_ssl.c>
</IfModule>

<Directory /var/www/example.com/web>
Options +FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory /var/www/clients/client0/web2/web>
Options +FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>"

Many Thanks for any help.

[edited by: incrediBILL at 6:07 pm (utc) on Jul 24, 2014]
[edit reason] unlinked URL [/edit]

cgkhwebservices

1:34 pm on Jul 24, 2014 (gmt 0)

10+ Year Member



Oops, There appears to have been a typo problem when posting this message.

5th Line should read:

However, http://www.example.com points to the correct virtual www. directory in the vhost conf file and BUT serves an error message.

Sorry

phranque

3:21 pm on Jul 24, 2014 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



welcome to Webmasterworld cgkhwebservices!


and the error was ...?

cgkhwebservices

5:42 pm on Jul 24, 2014 (gmt 0)

10+ Year Member



The error is that when one accesses the url without www. the web page loads. When one puts www in front the page does not load and give an error.

penders

5:49 pm on Jul 24, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



...when one accesses the url without www. the web page loads. When one puts www in front the page does not load and give an error.


Do you have a CNAME record in DNS for "www"?

lucy24

6:35 pm on Jul 24, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



the page does not load and give an error.

What type of error? Server or browser?

<VirtualHost *:80>

Where's the closing line?

phranque

12:47 am on Jul 25, 2014 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



the page does not load and give an error


please be more specific