Wp folder in root - index.php to require wp-blog-header.php not working

I am trying to create a index.php file inside htdocs of the folder of my domain rossorave.rf.gd to traverse into the root htdocs/wp/wp-blog-header.php

This is not working. “Failed to open stream”.

index.php
define( ‘WP_USE_THEMES’, true );
/** Loads the WordPress Environment and Template */
require( dirname( FILE ) . ‘…/…/htdocs/wp/wp-blog-header.php’ );

Ive also created a .htaccess
php_value display_errors On
php_flag magic_quotes 1
php_flag magic_quotes_gpc 1
php_value mbstring.http_input auto
php_value date.timezone Europe/Oslo

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

Now it throws me a different error, that is the open_basedir restriction in effect on some files. So you can’t use the files from the root htdocs folder; you must use the ones inside the htdocs folder of your domain.

Thanks for replying.
Now I am getting
open_basedir restriction in effect. File(/home/XX/XX/XX/htdocs/wp/wp-blog-header.php) is not within the allowed path(s):

I already edited the message of before, as I checked after the changes and saw that restriction. So please try to move all the WordPress files from the root htdocs folder to your domain’s htdocs folder, and only after that try to include the file from your domain’s htdocs folder.

2 Likes

Strange.
Because this worked when using an domain on a separate host.
Should I move all of the entire /wp folder?

Yes, you should, overwriting the old files.

2 Likes

Are you sure there is not a different way of doing this?
Because on my sub folder (rossorave.rf.gd) i have nothing except the index.php file from before, so I wont be overwriting any files.
The thing I wanted to do was to be able to use the domain even though I installed the wp folder on root inside a /wp folder.

Got it working by moving the entire /wp folder as you said. Thanks a bunch!

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.