Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I would like to access my site both with and without using the www. Currently it only works with. Leaving out the www just goes to a blank page. Also, wp-admin just loads a blank page too.

I have set an A record for mysite.com and www.mysite.com, both pointing to my static Bitnami IP. I also have a subdomain mapped to another directory that is working just fine (conference.mysite.com and www.conference.mysite.com).

I'm using a Bitnami stack on an AWS EC2 micro instance.

Here is my httpd.conf:

ServerRoot "/opt/bitnami/apache2"
Listen 80

LoadModule authn_file_module modules/mod_authn_file.so
blah blah blah....
LoadModule php5_module        modules/libphp5.so

<IfModule !mpm_netware_module>
<IfModule !mpm_winnt_module>
User daemon
Group daemon
</IfModule>
</IfModule>

ServerAdmin you@example.com
ServerName localhost:80
DocumentRoot "/opt/bitnami/apps/wordpress1/htdocs/"

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Allow from all
</Directory>

<Directory "/opt/bitnami/apps/wordpress1/htdocs/">
    Options Indexes MultiViews +FollowSymLinks
    LanguagePriority en
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>
<IfModule dir_module>
    DirectoryIndex index.html index.php
</IfModule>

<FilesMatch "^\\.ht">
    Order allow,deny
    Deny from all
    Satisfy All
</FilesMatch>
ErrorLog "logs/error_log"

LogLevel warn
<IfModule log_config_module>

    LogFormat "%h %l %u %t \\"%r\\" %>s %b \\"%{Referer}i\\" \\"%{User-Agent}i\\"" combined
    LogFormat "%h %l %u %t \\"%r\\" %>s %b" common
    <IfModule logio_module>
      LogFormat "%h %l %u %t \\"%r\\" %>s %b \\"%{Referer}i\\" \\"%{User-Agent}i\\" %I %O" combinedio
    </IfModule>

    CustomLog "logs/access_log" common
</IfModule>
<IfModule alias_module>
    ScriptAlias /cgi-bin/ "/opt/bitnami/apache2/cgi-bin/"
</IfModule>
<Directory "/opt/bitnami/apache2/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>
DefaultType text/plain
<IfModule mime_module>
    TypesConfig conf/mime.types
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
</IfModule>

Include conf/extra/httpd-mpm.conf

<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
AddType application/x-httpd-php .php .phtml
LoadModule wsgi_module modules/mod_wsgi.so
WSGIPythonHome /opt/bitnami/python

ServerSignature Off
ServerTokens Prod

AddType application/x-httpd-php .php
PHPIniDir "/opt/bitnami/php/etc"

Include "/opt/bitnami/apps/phpmyadmin/conf/phpmyadmin.conf"
ExtendedStatus On
<Location /server-status>
  SetHandler server-status
  Order Deny,Allow
  Deny from all
  Allow from localhost
</Location>

Include "/opt/bitnami/apache2/conf/bitnami/httpd.conf"
Include "/opt/bitnami/apps/virtualhost.conf"

Here is my virtual hosts file:

NameVirtualHost *:80

<VirtualHost *:80>
    ServerAdmin xx
    DocumentRoot "/opt/bitnami/apps/wordpress1/htdocs"
    ServerName mbird.com
    ServerAlias www.mbird.com
    ErrorLog "logs/wordpress-error_log"
    CustomLog "logs/wordpress-access_log" common
</VirtualHost>
<Directory "/opt/bitnami/apps/wordpress1/htdocs">
 Options Indexes MultiViews +FollowSymLinks
 AllowOverride All
 Order allow,deny
 Allow from all
</Directory>

### WordPress conference.mbird.com configuration ###
<VirtualHost *:80>
 ServerAdmin sysadmin@mbird.com
 DocumentRoot "/opt/bitnami/apps/wordpress/htdocs"
 ServerName conference.mbird.com
 ServerAlias www.conference.mbird.com
 ErrorLog "logs/confwordpress-error_log"
 CustomLog "logs/confwordpress-access_log" common
</VirtualHost>
<Directory "/opt/bitnami/apps/wordpress/htdocs">
 Options Indexes MultiViews +FollowSymLinks
 AllowOverride All
 Order allow,deny
 Allow from all
</Directory>
###
share|improve this question

1 Answer 1

Maybe, you should look wordpress config concerning site domains which are being served ('MULTISITE') or setup explicit apache redirect from domain to www.domain.

share|improve this answer
    
Not multisite, actually too different installations. How would I do such a redirect? –  two7s_clash Mar 25 '12 at 16:33
1  
Something like <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_HOST} ^example\.com$ [NC] RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L] </IfModule> somewhere in suitable place should do the work. Also, consider changing domain to no-www in settings, as WP v2.3 and above should handle this 'canonicalization' of urls by itself (see markjaquith.wordpress.com/2007/09/25/…) –  Vadym S. Khondar Mar 25 '12 at 17:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.