0

My WordPress installation is in a different folder from my main site:

/var/www/html/wordpress <= WP installation

/var/www/html/main-site <= main site

I would like to have WP display when someone visits /blog from my main site:

http://www.main-site.com/blog (Note: main-site is used as a generic placeholder for the real site because it is not launched yet)

I have set up an alias in my httpd conf file:

Alias /blog /var/www/html/wordpress 
<Directory /var/www/html/main-site>
    DirectoryIndex index.php
    Options -MultiViews
    AllowOverride All
    order allow,deny
    allow from all 
</Directory>

I have the following as my .htaccess file for WP:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>

I get a 404 when I visit http://www.main-site.com/blog but when I visit http://www.main-site.com/wp-admin/index.php, it works (but I get a 404 if I visit /admin). Visiting the sample blog post and sample page also works for me.

http://www.main-site.com/blog/hello-world/

http://www.main-site.com/blog/sample-page/

It looks like rewrite is working but my /blog index page doesn't work.

Any suggestions would be greatly appreciated.

Thanks,

Allen

1 Answer 1

0

Finally figured this one out! It turns out that Passenger was enabled.

Alias /blog /var/www/html/wordpress 
<Directory /var/www/html/main-site>
    PassengerEnabled off
    DirectoryIndex index.php
    Options -MultiViews
    AllowOverride All
    order allow,deny
    allow from all 
</Directory>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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