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.

I am using this tutorial Giving WordPress Its Own Directory to launch a WordPress (installed in a sub folder called wordpress) by using example.com instead of example.com/wordpress.

It says to copy index.php to your root folder and change the relative path to wp-blog-header.php accordingly. However, my folder structure is a little complex:

Folder Structure

To access site root I go to example.com. But to access WordPress I have to go to example.com/wordpress (if anyone wondering why I am using Bitnami WordPress stack AMI and thus everything came pre-configured)

According to tutorial I should copy index.php to site root from WordPress root and change relative location of wp-blog-header.php accordingly. When index.php was in same directory the function was require('./wp-blog-header.php') . Now this location is to be changed

I have tried all three options I could think of:

  1. ../apps/wordpress/htdocs/wp-blog-header.php

  2. ./wordpress/htdocs/wp-blog-header.php

  3. wordpress/htdocs/wp-blog-header.php

But visiting the domain root gives a server error. Any suggestions?

share|improve this question
add comment

3 Answers

I think you need to use:

define("ROOT", realpath(dir(__file__)) . "/");
require(ROOT . "apps/wordpress/htdocs/wp-blog-header.php");

Got this from the PHP.Net site however haven't used the code (Or use this type of code often) so can't guarantee it will work.

Cheers,
Joe

share|improve this answer
    
nope didnt work ! thanks anyhow –  Danny Dec 24 '12 at 22:02
add comment

Here is the answer http://wiki.bitnami.org/Components/Apache#How_to_change_the_URL.3f it was because of bitnami and not a fault of wordpress

share|improve this answer
add comment

I have used a setup similar to this on a different server. You need to code the full path to the WordPress installation into the require function. On a regular server this would start with /home/username/.

If you don't know the full path, you can use the dirname() function:

require( dirname( dirname( __FILE__ ) ) . '/apps/wordpress/htdocs/wp-blog-header.php');

The first call to dirname( __FILE__ ) returns the path to the htdocs (site root) folder. The second exits that folder to the Bitnami root.

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.