• I’m using Debian (5.0) with apache2 webserver. I intend to host more than one blog on the machine, so I installed wordpress to a subfolder “/var/www/example”. My domain name (say “www.example.com”) points to my server’s IP address, but then I need to go to “www.example.com/example/” to access the blog, when I want it to show up at “www.example.com”. I’ll also later want additional blogs with additional domain names. Say, install another wordpress to “/var/www/example2/”, and have another domain “www.example2.com” point to it.

    How do I configure it so that http://www.example.com points to the blog, but so that only connections from that domain go there, not any connection to my IP address?

    Thanks in advance.
    Devin

Viewing 3 replies - 1 through 3 (of 3 total)
  • I’m pretty sure you could do this with mod_rewrite but I’d have to think about that since, well, mod_rewrite is black magic mixed with alchemy and Lewis Carrol. Alternatively, a PHP switch in /var/www/index.php could handle the redirect and .htaccess in the subdirectories could shave off the directory names. I’m guessing that you want to do it this way because you want to register various domains but don’t want to pay for separate hosting for each of them?

    The easiest way to do this is with virtual hosts in the apache config.
    Here is a basic example of what the config should look like.

    <VirtualHost *:80>
    DocumentRoot "/var/www/example"
    ServerName example.com
    <Directory "/var/www/example">
    allow from all
    Options
    </VirtualHost>

    You also need to make sure this is in the apache config file as well

    NameVirtualHost *:80

    When you get around to your second challenge

    Need to edit wp-config.php so MYSQL can create separate DB

    /**
    * WordPress Database Table prefix.
    *
    * You can have multiple installations in one database if you give each a unique
    * prefix. Only numbers, letters, and underscores please!
    */
    $table_prefix = ‘wp_’;

    /**

    Just a thought — You probably already knew that though 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Domain name directly to wordpress?’ is closed to new replies.