Website can't be accessed with www.mywebsite.com?

Hi everyone,

I am not sure whether I have my configurations wrongly. I am using the updated wordpress version.

My website e.g. http://www.mywebsite.com.

I can view mydomain.com but not http://www.mywebsite.com. It will not show page can't be displayed or loads forever.

I am using Ubuntu 10.04 LTS 64 bits and apache2.

Any help please? Thank you.

My .htaccess as below:-

Note: I tried the commented version, but it didn't work or worst show error 500

RewriteEngine On

RewriteBase /

RewriteCond %{HTTP_HOST} ^mywebsite.com$

RewriteRule ^(.*)$ "http\:\/\/www.mywebsite.com\/$1" [R=301,L]

RewriteCond %{HTTP_HOST} !^www.mywebsite.com [NC]

RewriteRule (.*) http://www.mywebsite.com/$1 [L,R=301]

RewriteRule ^index.php$ - [L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . /index.php [L]

In /etc/apache2/sites-available/mywebsite.com (ln -s in sites-enabled)

ServerName mywebsite.com

ServerAlias *.mywebsite.com (can't work)

ServerAlias http://www.mywebsite.com (can't work too)

ServerAdmin webmaster@localhost

DocumentRoot /home/myuser/mywebsite.com/public

Options FollowSymLinks

AllowOverride All

Options Indexes FollowSymLinks MultiViews

AllowOverride All

Order allow,deny

allow from all

Options Indexes FollowSymLinks MultiViews

AllowOverride All

Order allow,deny

allow from all

Options Indexes FollowSymLinks MultiViews

AllowOverride All

Order allow,deny

allow from all

ErrorLog /home/myuser/mywebsite.com/logs/error.log

Possible values include: debug, info, notice, warn, error, crit,

alert, emerg.

LogLevel warn

CustomLog /var/log/apache2/access.log combined

In /etc/apache2/sites-available/default, I didn't modify anything

ServerAdmin webmaster@localhost

DocumentRoot /var/www

Options FollowSymLinks

AllowOverride None

Options Indexes FollowSymLinks MultiViews

AllowOverride None

Order allow,deny

allow from all

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/

AllowOverride None

Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch

Order allow,deny

Allow from all

ErrorLog /var/log/apache2/error.log

Possible values include: debug, info, notice, warn, error, crit,

alert, emerg.

LogLevel warn

CustomLog /var/log/apache2/access.log combined

Alias /doc/ "/usr/share/doc/"

Options Indexes MultiViews FollowSymLinks

AllowOverride None

Order deny,allow

Deny from all

Allow from 127.0.0.0/255.0.0.0 ::1/128

5 Replies

You need:

ServerAlias www.mywebsite.com

I tried that, makes no differences. Any idea?

You did set a DNS record to point www to your IP?

This is my vhost for a domain which works fine:

 <virtualhost *:80="">ServerAdmin admin@nuvini.com
     ServerName mydomain.com
     ServerAlias www.mydomain.com
# Logs
     DocumentRoot /srv/www/mydomain.com/public_html/
     ErrorLog /srv/www/mydomain.com/logs/error.log
     CustomLog /srv/www/mydomain.com/logs/access.log combined

# phpfpm/fastcgi
 <ifmodule mod_fastcgi.c="">AddHandler php5-fcgi .php
        Action php5-fcgi /fastcgi/php5.mydomain.external
        Alias /fastcgi/php5.mydomain.external /php5.mydomain.external
        FastCgiExternalServer /php5.mydomain.external -socket /var/run/apache2/php-fpm-mydomain.sock -appConnTimeout 30 -idle-timeout 60

 <location fastcgi="" php5.mydomain.external="">Order Deny,Allow
        Deny from All
        Allow from env=REDIRECT_STATUS</location></ifmodule> 

# Enable Rewrite
RewriteEngine On

 <directory "="" srv="" www="" mydomain.com="" public_html"="">AllowOverride All</directory></virtualhost> 

Somethings definitely wrong,

I can't see either mydomain.com or www.mywebsite.com

Are you sure the servers are switched on?

@vonskippy:

Somethings definitely wrong,

I can't see either mydomain.com or http://www.mywebsite.com

Are you sure the servers are switched on?

vonskippy's point is POST YOUR REAL DOMAIN NAME. We can help with a lot more troubleshooting that way.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct