WordPress.org

Ready to get started?Download WordPress

Forums

Hosting WP in a subdirectory (5 posts)

  1. jimmy216
    Member
    Posted 3 years ago #

    Hello,

    I have a tricky problem. I'm currently using WP 3.1 installed on a private server. This is the organisation of the server :

    /var/www

    • index.php
    • other files
    • a couple of folders
    • wordpress (which is the main directory of wordpress)

    WordPress is installed in its MU version using subdomains.
    My problem is that I want to provide to my users a URL like this : http://subdomain.domain.com/ at the oposite of the current URL http://subdomain.domain.com/wordpress/

    I tried to solve my problem using VirtualHost but it doesn't work properly, it seems not to be able to communicate with the .htaccess.

  2. If you want http://subdomain.domain.com/ then you absolutely must install it at http://domain.com/.

    no, no workarounds.

  3. UNLESS you want your sites to be subdomain.domain.com/wordpress/blogname

    (or if you want subdomain.domain.com/blogname, at which point you would install in /var/www/subdomain and start from there)

  4. jimmy216
    Member
    Posted 3 years ago #

    Not that tricky finally, I just had to turn things around.

    This is my config :

    <VirtualHost *:80>
    ServerName http://www.mydomain.com
    DocumentRoot /var/www
    </VirtualHost>

    <VirtualHost *:80>
    ServerName mydomain.com
    ServerAlias *.mydomain.com
    DocumentRoot /var/www/wordpress

    <Directory />
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]

    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]

    RewriteRule . index.php [L]
    </Directory>
    </VirtualHost>

    I kicked out the .htaccess and everything is running well !

    My website run at http://www.mydomain.com and blogs run at subdomain.mydomain.com

    By the way thanks for the support :P

  5. DocumentRoot /var/www/wordpress

    Or that. :D I had actually thought of suggesting that bit, but I'm still recovering here, so my brain is a little slow on the uptake. (more so than usual ;P )

Topic Closed

This topic has been closed to new replies.

About this Topic