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:
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:
-
../apps/wordpress/htdocs/wp-blog-header.php
-
./wordpress/htdocs/wp-blog-header.php
-
wordpress/htdocs/wp-blog-header.php
But visiting the domain root gives a server error. Any suggestions?
I think you need to use:
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
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
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:The first call to
dirname( __FILE__ )
returns the path to the htdocs (site root) folder. The second exits that folder to the Bitnami root.