Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Okay I've googled this for hours...I installed wordpress to a subdirectory as a content management system, but I want my main index.php along with other files to remain in the root.

What .htaccess code do I need to so that the main url http://foo.com/index.php doesn't look for the wordpress/index.php (which of course causes the error "Warning: require(./wp-blog-header.php) [function.require]: failed to open stream: No such file or directory in /home/..."

share|improve this question
    
Are you trying to call wordpress functions from your index.php? If you have the content of wordpress installed in your subdirectory then foo.com/index.php shouldn't be returning an error. –  Pollux Khafra Sep 2 '12 at 23:33
add comment

1 Answer

up vote 1 down vote accepted

WordPress core in a subdirectory, but accessed via the root folder

If you're trying to move WP to a subdirectory, but access it from the root, use the following approach.

Keep your index file in the root, but point it to the proper path: ./SUBDIRECTORY/wp-blog-header.php instead of ./wp-blog-header.php

Make sure you change you change the home and siteurl settings to match your directory structure either in Settings->General or by adding the following to your wp-config.php file:

define('WP_HOME','http://yourdomain.com');
define('WP_SITEURL','http://yourdomain.com/SUBDIRECTORY');

WordPress completely isolated to a subdirectory

If you would like to keep WP completely in the subdirectory, just move your .htaccess index.php files to the sub instead of the root. As long as it doesn't conflict with the root .htaccess, it should work just fine. You can have nested .htaccess files within subdirectories and permalinks should work just fine.

share|improve this answer
add comment

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.